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
105
client side afterSelectedIndexChange error
posted

I have a tab control on an ASCX with 12 tabs.  I wrote a simple handler for client-side afterSelectedTabChange.  The handler just retrieves the selected index from the tab control (using owner parameter) and stores it in a hidden text field.  If I click the first 4 tabs, any number of times, this works perfectly.  If I click tabs 5 throug 12, javascrip throws the error "'ID' is null or not an object."  I added an alert to the first line of my event handler and in the error cases, it does not fire, so I know its code executing before my event handler.  I tried moving error-throwing tabs up to the earlier (working) positions and they worked fine, so I've ruled out something being wrong with the configuration of those tabs specifically.  But I'm stuck.  I can't think of anything else to test and I can't fix it.  Any help would be greatly appreciated.

  • 24497
    posted

    Hi,

    It sounds like an error in your codes. If application is complex, then it can be hard to find problem. Try to buid a temporary page which contains only tab with afterSelectedTabChange (put alert in your handler without any hidden fields access). It probably will work. Now try to move that tab into ASCX and test it. It probably will work same way. Now add other logic like hidden fields, etc. Eventually you should find where problem happens.