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.
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);
jakeharlan_ibs said: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.
This is correct behavior for ASP.NET controls. You would need to re-add the user control on every postback, and you would need to do it at the same point in the page lifecycle each time.
jakeharlan_ibs said: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.
Try using the UserControl property off the ContentPane object. If you want particular properties off your user control's class, you'll have to cast it to the appropriate class.