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

Question about ContentURL on multipage and tabstrip

1 Answer 50 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 30 Oct 2012, 02:59 PM
Hi , i am new to Telerik and web development. I have write a page that it contain a button, tabstrip and multipage. When the button click, it will dynamic create a new radtab and radpageview which contain contenturl. However, when i create the second tab and so on, the multipage will only show the radpageview that just created, the rest of the other tab become blank. For example: when i click the button,
test.aspx page show on the radpageview. Then i click the button again,  test2.aspx page show, but test first tab which is test.aspx become blank. 

Is there any way i can create the tab dynamically without losing the previous tab and the pageview content? thanks

and here is my testing Code.

   protected void Button1_Click(object sender, EventArgs e)
        {
            RadTab rootTab = new RadTab();
            TabStrip.Tabs.Add(rootTab);
            rootTab.Text = TabStrip.Tabs.Count.ToString();
            rootTab.PageViewID = "RadPageView" + TabStrip.Tabs.Count.ToString();
            RadPageView newPageview = new RadPageView();
            newPageview.Width = new Unit("100%");
            newPageview.ID = "RadPageView" + TabStrip.Tabs.Count.ToString();
            newPageview.ContentUrl = "test" + TabStrip.Tabs.Count.ToString() + ".aspx";
            RadMultiPage1.PageViews.Add(newPageview);
        }

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 01 Nov 2012, 02:57 PM
Hello Michael,

Since you create the PageViews dynamically,  you should add the ContentUrl in the PageViewCreated event.
I have prepared a sample project for you, in order to demonstrate you the correct implementation. Please find it attached.


All the best,
Nencho
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
TabStrip
Asked by
Michael
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or