使用Razor设置绑定剑道UI MVC TabStrip的内容
设置数据绑定tabstrip的选项卡内容时遇到问题。我找到了一个如何使用webforms语法进行转换的示例,但无法成功地将其转换为razor: 以下是webforms语法:使用Razor设置绑定剑道UI MVC TabStrip的内容,razor,kendo-ui,Razor,Kendo Ui,设置数据绑定tabstrip的选项卡内容时遇到问题。我找到了一个如何使用webforms语法进行转换的示例,但无法成功地将其转换为razor: 以下是webforms语法: 您必须使用.InlineTemplate…而不是.Content tab.Template.InlineTemplate = @<text> @(Html.EditorFor(model => tabModel, "WorkOrder", tabModel))
您必须使用.InlineTemplate…而不是.Content
tab.Template.InlineTemplate =
@<text>
@(Html.EditorFor(model => tabModel, "WorkOrder", tabModel))
</text>;
tab.Template.InlineTemplate=
@
@(Html.EditorFor(model=>tabModel,“WorkOrder”,tabModel))
;
@(Html.Kendo().TabStrip()
.Name("OrderDetailsTabs")
.BindTo(Model, (item, model) =>
{
item.Text = "Part: " + model.WOHdr.OrderDetailId; // tab text
item.Content = () =>
{
(@<text>
Test @(model.WOHdr.Id)
</text>);
};
A local variable named 'item' cannot be declared in this scope because it would give a different meaning to 'item', which is already used in a 'parent or current' scope to denote something else
tab.Template.InlineTemplate =
@<text>
@(Html.EditorFor(model => tabModel, "WorkOrder", tabModel))
</text>;