2013-07-10 70 views
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 

回答

0

你哈已經使用.InlineTemplate ...不是。內容

tab.Template.InlineTemplate = 
     @<text> 
      @(Html.EditorFor(model => tabModel, "WorkOrder", tabModel)) 
     </text>;