6

如何在 kendo 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>);
          })
    )

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

有任何想法吗?

谢谢

4

3 回答 3

8

它现在支持控制器/动作

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

在家庭控制器中:

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

希望这可以帮助

于 2014-05-20T15:39:47.963 回答
8

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

于 2013-11-21T08:30:05.833 回答
6

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

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

              }))
于 2015-01-25T20:14:32.353 回答