Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
660
WebTab and User Controls
posted

If I wanted to have each tab to be an 'instance' of the same user control, is this straightforward?  Would there be any issues related to data not updating on each tab or showing duplicate information on each tab?

 

Thanks.

 

Parents
No Data
Reply
  • 380
    posted

     Yes, you will run into issues.

     

    I am currently attempting the same thing and have found that if you use LoadControl() when adding your new tab you will lose the UserControl (but not the new Tab) on a PostBack.

                int tabs = mytab.Tabs.Count + 1;
                Infragistics.WebUI.UltraWebTab.Tab tab = new Infragistics.WebUI.UltraWebTab.Tab("Tab" + tabs);
                Control uc = LoadControl("~/tabUserControl.ascx");
                uc.ID = "Tab" + tabs;
                tab.ContentPane.Controls.Add(uc);
                mytab.Tabs.Add(tab);    

     

    If you use .UserControlURL() to load the usercontrol it will retain through PostBack, but I have been unable to reference the UserControl by name in the CodeBehind.

                int tabs = mytab.Tabs.Count + 1;
                Infragistics.WebUI.UltraWebTab.Tab tab = new Infragistics.WebUI.UltraWebTab.Tab("Tab" + tabs);
                tab.ContentPane.UserControlUrl = "~/tabUserControl.ascx";
                mytab.Tabs.Add(tab);

Children