开发者

My telerik mvc tabstrip does not work

开发者 https://www.devze.com 2023-02-07 22:53 出处:网络
I have a TabStrip in a UserControl that is shown in a Telerik window. This window is shown as a result of the addition of one record in a Telerik grid, but i cant change the tabs clicking on it.

I have a TabStrip in a UserControl that is shown in a Telerik window. This window is shown as a result of the addition of one record in a Telerik grid, but i cant change the tabs clicking on it.

I could try to make it work with TabStrip events and some javascript but this stuff is done in the control (I'm sure in the Telerik example they do nothing to make it work).

I have added the <%: Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Combined(true).Compress(true)) %> to load all javascript needed, I suppose it must be something like I must add some script but I have no idea. I have created my project from Telerik Mvc Project Addin for VS 2010 so it put all what i need in the project already.

Some help would be great.

I will copy here the TabStrip code, maybe it is something in the code, but I'm just copying and pasting the same TabStrip from the example.

<%
    Html.Telerik().TabStrip()
        .Name("TabStrip")
        .Items(items =>
        {
            items.Add().Text("Item 1")
   开发者_如何学JAVA              .Content(() =>
                 {%>
<p>
    Content</p>
<%});
            items.Add().Text("Item 2")
                 .Content(() =>
                 {%>
<p>
    Content</p>
<%});
        })
        .SelectedIndex(0)
        .Render();
%>


You may have hit this problem. The solution is to include the JavaScript files required by the TabStrip.


@Html.Telerik().TabStrip().Name("TabStrip").Items(items =>
{
    items.Add().Text("First").Content(@<p>First Page</p>);
    items.Add().Text("Second").Content(@<p>Second Page</p>);

}).SelectedIndex(0)

The above code worked for me. You can replace @ by <%= %>..

0

精彩评论

暂无评论...
验证码 换一张
取 消