This is a migrated thread and some comments may be shown as answers.

Load the contents of the tab only when a tab is clicked

1 Answer 552 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
RJ
Top achievements
Rank 1
RJ asked on 04 Apr 2016, 08:34 PM

Hi,

I am using tabstrip to load content from different partial views. I am doing it as below:

 

@(Html.Kendo().TabStrip()
    .Name("tabstrip")
    .Items(tabstrip =>
    {
        tabstrip.Add().Text("Tab1");
        tabstrip.Add().Text("Tab2");
    })
    .ItemAction(item=>
    {
        if(.....)
        {
            item.Selected = true;
            item.Html = Html.Partial("Tab1").ToString();
        }
        else if(....)
        {
            item.Selected = true;
            item.Html = Html.Partial("Tab2").ToString();
        }
    })
    )

 

When I do it without specifying if/else's, I am having issues loading the partial views. Each partial view is having kendo editor and in the editor we have some content and url's. Without using if/else, when I load the tabs by rendering the partials, the partial that is rendered first is loaded without issues. But the partial that is rendered after loading the first partial, does not load the 2nd partial correctly. It has issues like, url's are not clickable inside of the editor and even the editor is behaving unexpectedly.

Going through the threads in this forum, gave me the idea of using if/else and I thought that might be helpful. But, I am not sure how to specify the condition in there to know which tab is clicked.

 

I tried using condition like if(item.Text.Equals("Tab1"), but this is of no use. I am getting same error again.

Please help!

 

Thanks.

 

 

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 06 Apr 2016, 03:53 PM
Hi Romica,

Based on the provided information, it sounds like there are duplicate IDs in the various partial views that the TabStrip renders. This violates web standards and cannot be supported. Please use unique IDs in all partial views that may be rendered on the page. The same requirement exists also if a Kendo UI TabStrip is not used.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TabStrip
Asked by
RJ
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or