TabStrip - First Tab only loaded properly.

2 posts, 0 answers
  1. I Sam Asir
    I Sam Asir avatar
    2 posts
    Member since:
    Feb 2015

    Posted 20 Feb 2015 Link to this post

    Tab Strip - Dynamic PageView Creation via AJAX :

    I have tried the sample given in telerik site. But the first PageView only loaded. The other 2 tabs doesn't get loaded.
    I have used an usercontrol for all the three tabs. Please find the code below.


    Home.aspx.cs

      protected void Page_Load(object sender, EventArgs e)
            {

            }
            protected void Page_Init(object sender, System.EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    AddTab("RadScheduler");
                    AddPageView(RadTabStrip1.FindTabByText("RadScheduler"));
                    AddTab("RadGrid");
                    // AddPageView(RadTabStripMembersAdditionalInfo.FindTabByText("RadGrid"));
                    AddTab("RadHTMLChart");
                    //AddPageView(RadTabStripMembersAdditionalInfo.FindTabByText("RadHTMLChart"));

                }
            }

            private void AddTab(string tabName)
            {
                RadTab tab = new RadTab();
                tab.Text = tabName;
                tab.Width = Unit.Pixel(200);
                RadTabStrip1.Tabs.Add(tab);
            }

            protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
            {
                //string userControlName = e.PageView.ID + "CS.ascx";            
                Control userControl = Page.LoadControl("~/_UserControlAdditionalInfo1.ascx");
                userControl.ID = e.PageView.ID + "_userControl";

                e.PageView.Controls.Add(userControl);
            }

            private void AddPageView(RadTab tab)
            {
                RadPageView pageView = new RadPageView();
                pageView.ID = tab.Text;
                pageView.CssClass = "contentWrapper" + tab.Index;
                RadMultiPage1.PageViews.Add(pageView);
                tab.PageViewID = pageView.ID;
            }
            protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }
            protected void RadTabStripMembersAdditionalInfo_TabClick(object sender, RadTabStripEventArgs e)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }
  2. I Sam Asir
    I Sam Asir avatar
    2 posts
    Member since:
    Feb 2015

    Posted 21 Feb 2015 Link to this post

    Me itself fix the issue.

    Fix:
    I have removed the IsPostBack property from the UserControl's Page_Load event. It renders the page exactly what i have desired.

    Thanks
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top