【问题标题】:Kendo, Razor braces problems剑道,剃刀牙套问题
【发布时间】:2013-01-20 14:31:28
【问题描述】:

我检查了大括号、括号 100 次...我认为它们放置正确,但我明白了

"在逐字说明符之后需要的关键字、标识符或字符串:@"

<script id="customercontactsTemplate" type="text/kendo-tmpl">
   @(Html.Kendo().TabStrip()
        .Name("TabStripCustomer")
        .SelectedIndex(0)
        .Items(items =>
        {
         items.Add().Text("Contacts").Content(obj => 

                 @(Html.Kendo().Grid<ModelApp.Models.CustomerContacts>()
                    .Name("customercontacts")
                    .Columns(columns =>
                    {
                    columns.Bound(l => l.CustomerContactID);
                    columns.Bound(l => l.CustomerID);
                    columns.Bound(l => l.CustomerContactName);
                    columns.Bound(l => l.CustomerContactPhone);
                    columns.Bound(l => l.CustomerContactDuty);
                    })
                    .DataSource(dataSource => dataSource
                    .Ajax()
                    .Model
                    (model=>{
                        model.Id(l => l.CustomerContactID);
                        model.Field(l=>l.CustomerContactID).Editable(false);
                        model.Field(l => l.CustomerID);
                        model.Field(l => l.CustomerContactName);
                        model.Field(l => l.CustomerContactPhone);
                        model.Field(l => l.CustomerContactDuty);
                             }
                     )
                    .Read(read => read.Action("CustomersContactsRead", "Customers", new { customerID = "#=CustomerID#" }))
                    .Update(update => update.Action("CustomersContactsEdit", "Customers"))
                    .Create(update => update.Action("CustomersContactsCreate", "Customers", new { customerID = "#=CustomerID#" }))
                    )
                    .Events(e => e.Edit("onEdit"))
                    .Pageable()
                    .Sortable()
                    .Editable(editing => editing.Mode(GridEditMode.InCell))
                    .ToolBar(toolbar =>
                    {
                        toolbar.Create();
                        toolbar.Save();
                    })
                    .ToClientTemplate())



                                           );}))

有大括号代码检查器吗?你能发现任何错误吗?

提前谢谢!

【问题讨论】:

  • 这是一大段代码。一般我使用@(variable-to-display),和@{large code block to execute}
  • 你用什么视图引擎,是 ASPX 吗?
  • .cshtml - VS2010,实体框架,带有 KendoUi 的 C#

标签: razor kendo-ui


【解决方案1】:

问题出在这一行

Content(obj => @(Html.Kendo().Grid<ModelApp.Models.CustomerContacts>()

在剃须刀中你应该使用template delegates:

Content(@<text>
    @(Html.Kendo().Grid<ModelApp.Models.CustomerContacts>()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-29
    • 1970-01-01
    • 1970-01-01
    • 2014-01-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多