I have a page with a webTab, and each tab references a new page. Page #1 (default page) has a textbox and a search button. When I click 'search', a gridview on tab #3 ("Activity") is populated using the textbox data as search criteria for a database table.
<div id="content"> <ig:WebTab ID="wtWctr" runat="server" CssClasses-CssClass="CenterScreen" Width="1100px" Height="850px"> <%-- <AutoPostBackFlags SelectedIndexChanged="On" />--%> <Tabs> <ig:ContentTabItem runat="server" ContentUrl="Wctr_Inquiry_Update.aspx?Header=False" Key="tabInquiry" Text="Inquiry"/> <ig:ContentTabItem runat="server" Hidden="True" Key="tabExceptions" Text="Exceptions"/> <ig:ContentTabItem runat="server" ContentUrl="Wctr_Activity.aspx?Header=False" Key="tabActivity" Text="Activity" EnableLoadOnDemandUrl="True"/> <ig:ContentTabItem runat="server" Hidden="True" Key="tabRates" Text="Rates" CssClass="tabHeight" /> <ig:ContentTabItem runat="server" ContentUrl="Wctr_Machine_Types.aspx?Header=False" Key="tabMachineTypes" Text="Machine Types"/> <ig:ContentTabItem runat="server" ContentUrl="Wctr_Types.aspx?Header=False" Key="tabWctrTypes" Text="Wctr Types"/> <ig:ContentTabItem runat="server" ContentUrl="MassWctrUpdate.aspx" Key="tabMassWctrUpdate" Text="Mass Wctr Update"/> </Tabs> </ig:WebTab></div>
When I do a search and then click to tab #3, it works fine.
When I return to tab #1, do another search, and switch to tab #3, the data from the original search persists.
If I add <AutoPostBackFlags SelectedIndexChanged="On" /> to the WebTab, every screen posts back twice, making the screen display the data, flash, and display the data again. I have tried encompassing the webTab in an update panel, changed the postback flag to async, and tried every combination of the EnableLoadOnDemand functions that the webTab has to offer. How do I resolve this?
Hello Jesse Oresnik,
Thank you for posting in our community.
In order to ensure that your issue is addressed correctly I will need a simplified working sample of your project where the issue is reproducible.
This is going to be highly appreciated and would help me to investigate this matter further in pursuit of the root cause of this issue.
Please let me know if you have any additional questions regarding this matter.
Looking forward to hearing from you.
I don't know if that will be feasible, since it is part of an intranet that has literally hundreds of pages, and has a master page. But it seems like it should be easy to reproduce:
What you should notice when you do the above is that if auto postback is not enabled, the page_load function for the 2nd tab page is only run the first time the tab is clicked. If auto postback is enabled, the page_load for the 2nd tab page is run twice every time the tab is clicked.
For a temporary workaround, I currently force the page to re-load when they click on tab 1. It is an improvement, but the screen still flashes whenever they click tab 1.
Hello Jesse,
Thank you for your clarification. I am currently working on creating a sample to reproduce the issue.
I will keep you posted on my progress and I will get back to you as soon as I have any new information or questions for you.
Please feel free to contact me if you have any additional questions regarding this matter.
Hello Jessie,
Thank you for you patience while I was looking into this.
I followed the steps that you suggested and created a small sample project. However, I was unable to reproduce the behavior that you are describing. I added WebTab control to the page with two tabs, each having the ContentUrl property set to a different aspx page. AutoPostBackFlags of the SelectedIndexChanged event are turned on to ensure that a postback will occur every time the active tab is changing. In the first tab, as you suggested, I have textbox and a button. Once the button is clicked a variable in the session is set according to the value of the textbox and afterwards when the second tab is accessed the data source for a grid is set according to this value.
I am attaching the sample I used to test this for your reference. Please test this on your side; whether or not it works correctly may help indicate the nature of this issue.
If this sample is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me.
Please let me know if you need any further assistance with this matter.