My requirement is to load the user control only when the user navigates between the tabs by clicking on a tab. By default, WebTab loads all the user control.I cannot afford loading all the user controls as our controls are extensive in UI and data. We plan to create 4 tabs.
Can this be achieved using the WebTab control? I would appreciate your response!
<ig:WebTab ID="WebTab1" runat="server" Height="200px" Width="300px">
Hello Ram,
You can set the property EnableLoadOnDemand to true, and then only the selected tab will be loaded. You can find information for all TabPostBackOptions here:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.2/CLR4.0/html/Infragistics4.Web.v10.2~Infragistics.Web.UI.LayoutControls.TabPostBackOptions_members.html
Hope this helps.
Regards,
Lyuba
Developer Support Engineer
Infragistics
www.infragistics.com/support
Hey Lyuba,
I tried a sample with 2 tabs and the property PostBackOptions-EnableLoadOnDemand="true".
Tab 1 has UserControlUrl property set to "WebUserControl1.ascx"Tab 2 has UserControlurl property set to "WebUserControl2.ascx"
Both user controls has a textbox and the following code in the page_load event -if (!Page.IsPostBack){ TextBox1.Text = DateTime.Now.ToString();}
When the page is first loaded (i.e. IsPostBack=false), only page_load of UserControl1 is executed. When I now click on tab 2, page_load of both the user controls are executed twice and both the times, the IsPostBack=true. The code in the page_load event of UserControl2 does not fire because of the IsPostBack=true. This means both the user controls are loaded during the initial page load. This is not what I am looking for.
I want the user control to load on tab click. That means, when a tab is clicked, IsPostBack property should be false. As if, you are loading the control programmatically.
Can this achieved using the WebTab control?
I am attaching the sample for your reference. I would really appreciate, if you can guide in the right direction. I had to remove the ig_res folder from the zip file due to file size upload restriction.