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

[Solved] Subsequent on tab strip tabs open partial view outside of tab strip

1 Answer 50 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jon Baron
Top achievements
Rank 1
Jon Baron asked on 30 May 2012, 06:26 PM
So I have another issue with tab strips. I create them this way:

@{ Html.Telerik().TabStrip()
        .Name("TabStrip")           
        .Items(tabstrip =>
        {
            foreach (var verb in MEF.GetTabVerbsForCategory("2"))
            {
                var name = verb.Name;
                var image = verb.Image;
                var action = verb.Action;
                var controller = verb.Controller;
                var view = verb.View;
                 
                tabstrip.Add()
                    .Text(name)
                    .ImageUrl(image)
                    .Action(action, controller)
                    .Content(() => Html.Partial(view).ToHtmlString()
                    );         
            }               
        })                         
        .SelectedIndex(1)
        .Render();               
}

And in the action return a partial view. This works fine on the first navigation through the tab strip. But on subsequent clicks, the partial views are rendered instead completely in the window, ie. they are no longer in the tab strip.

1 Answer, 1 is accepted

Sort by
0
Jon Baron
Top achievements
Rank 1
answered on 30 May 2012, 06:38 PM
Instead of .Content, the below seems to work.

.LoadContentFrom(action, controller);
Tags
TabStrip
Asked by
Jon Baron
Top achievements
Rank 1
Answers by
Jon Baron
Top achievements
Rank 1
Share this question
or