2013-10-06 38 views
4

我怎麼能與渲染部分劍道UI做一個標籤條...如何使用劍道UI標籤條渲染部分

這是我一直在努力

@(Html.Kendo().TabStrip() 
      .Name("tabstrip") 
      .Items(tabstrip => 
      { 
       tabstrip.Add().Text("COES Details") 
        .Selected(true) 
        .Content(@<text> 
        @{Html.RenderPartial("ViewCOESDetails", @Model.COESDetails);} 
        </text>); 

       tabstrip.Add().Text("New York") 
        .Content(@<text> 
        <div class="weather"> 
         <h2>29<span>&ordm;C</span></h2> 
         <p>Sunny weather in New York.</p> 
        </div> 
        <span class="sunny">&nbsp;</span> 
        </text>); 

       tabstrip.Add().Text("Moscow") 
        .Content(@<text> 
        <div class="weather"> 
         <h2>16<span>&ordm;C</span></h2> 
         <p>Cloudy weather in Moscow.</p> 
        </div> 
        <span class="cloudy">&nbsp;</span> 
        </text>); 

       tabstrip.Add().Text("Sydney") 
        .Content(@<text> 
        <div class="weather"> 
         <h2>17<span>&ordm;C</span></h2> 
         <p>Rainy weather in Sidney.</p> 
        </div> 
        <span class="rainy">&nbsp;</span> 
        </text>); 
      }) 
    ) 

它只是顯示標籤外部的頁面...什麼是正確的語法...

有什麼想法嗎?

感謝

回答

6

tabstrip.Add().Text("COES Details").Enabled(true) .Content(@Html.Partial("path of the Partialview", Model).ToHtmlString());

6

它現在支持控制器/動作

@(Html.Kendo().TabStrip() 
    .Name("tabstrip") 
    .Items(tabstrip => 
    { 
     tabstrip.Add().Text("File").LoadContentFrom("FileTab","Home"); 
    }) 
) 

,並在家庭控制器:

public ActionResult FileTab() 
{ 
    return PartialView("_FileTabPartial"); 
} 

希望這有助於

3

我向選項卡條添加多個部分視圖。在這種情況下,每個標籤有一個局部視圖:

@(Html.Kendo().TabStrip() 
       .Name("Information") 
       .Items(tabstrip => 
       { 
        tabstrip.Add().Text("Tab 1") 
        .Selected(true) 
        .Content(Html.Partial("~/Areas/People/Views/Contact/_AustraliaPartial.cshtml", Model.Australia).ToHtmlString()); 

        tabstrip.Add().Text("Tab 2 ") 
        .Content(Html.Partial("~/Areas/People/Views/Contact/_NewZealandPartial.cshtml", Model.NewZealand).ToHtmlString()); 

        tabstrip.Add().Text("Tab 3") 
        .Content(Html.Partial("~/Areas/People/Views/Contact/_SamoaPartial.cshtml", Model.Tonga).ToHtmlString()); 

       }))