如何在kendo ui标签条中使用render partial

时间:2013-10-06 11:24:01

标签: kendo-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>);
          })
    )

它只显示选项卡外部的页面......正确的语法是什么......

任何想法?

由于

3 个答案:

答案 0 :(得分:8)

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

答案 1 :(得分:7)

它现在支持控制器/操作

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

并在家庭控制器中:

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

希望这有帮助

答案 2 :(得分:4)

我将多个部分视图添加到标签条。在这种情况下,每个标签一个部分视图:

@(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());

              }))