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
523
Setting Active Tab on Page load
posted

I have a Set of tabs(5 total), each tab has a listview on it.  Control works fine when switching tabs and loading data.  The problem arrises when I try to change the selected tab when the user first request the page and has a value in the request url.  Example MYPage.aspx?t=3, so the page defaults to tab 3 instead of the first tab.  The error the pops up is the listview on the tab doesn't exist

 The error I get says it can't find the listview control on the page...

Error Message

IPageableItemContainer 'listview3' not found.
Description: An unhandled exception occurred during the execution of the current web request.  Exception Details: System.InvalidOperationException: IPageableItemContainer 'listview3' not found.

Sample Code in page_init

 If Not Request.Item("t") Is Nothing Then
   If IsNumeric(Request.Item("t")) Then
    WebTab1.SelectedIndex = CInt(Request.Item("t"))
   End If
  Else
   WebTab1.SelectedIndex = 0
  End If

Strip down sample of webtab, I have removed the tabs/control in tab since the code is huge.

HTML/Control

     <ig:WebTab ID="WebTab1" runat="server" Height="550px" Width="100%" onselectedindexchanged="WebTab1_SelectedIndexChanged" StyleSetName="Default">
      <tabs>
      </tabs>
      <PostBackOptions EnableLoadOnDemandUrl="true" EnableLoadOnDemand="true" EnableReloadingUnselectedTab="true" EnableAjax ="true"/>
      <AutoPostBackFlags SelectedIndexChanged ="On"/>
     </ig:WebTab>

 I am hoping I am just setting the active tab wrong, or at the wrong time, or there is something else I am missing.