0
順利設定的數據綁定標籤欄標籤內容。我發現瞭如何使用Web表單語法給它一個例子,但是不能成功地將它轉換爲剃刀:設置內容使用剃刀
這裏是web表單語法from here:
.BindTo(Model,
(item, navigationData) =>
{
item.Text = navigationData.Text;
item.ImageUrl = navigationData.ImageUrl;
item.Content =() =>
{%>
Some random content I want to appear
<% };
})
這裏是我正在試圖做的剃刀:
@(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