Link to home
Create AccountLog in
Avatar of MinnRick
MinnRickFlag for United States of America

asked on

jQuery UI Tabs and Update Panels

Hello Experts -
I have an ASP.NET (VB.NET) application into which I have integrated tabs functionality from jQuery UI.  I have Update Panels inside each of the tabs and am using an external .js file.  The issue is that my external javascript seems to be disappearing from the app subsequent to postbacks within the tabs.  It almost seems as if the external .js file is getting lost once a postback occurs.

If this makes any sense to anyone then I'd really like to understand what is happening and if there is a way to ensure that postbacks occurring within Update Panels within jQuery UI tabs don't corrupt externally-located javascript.  Thanks for any assistance!

-- Rick
Avatar of Justin Pilditch
Justin Pilditch
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of MinnRick


I can't seem to replicate it in a simple example (the original site is too big to post here).  Guess I'll have to try something else with my tabs.  Thanks for the attempt Murfur - you're welcome to the points.
Well that's very kind of you!

OK, so apologies in advance if any of this is teaching you to suck eggs but I am just thinking aloud my process of elimination... ever hopeful that any of this might serve to nudge you in the right direction...

Unable to replicate error in simple example suggests that you have not replicated the offending code in the example.

You mentioned that your external js is disappearing subsequent to post back  - so where is your js include statement? Possibly within a tab that effectively has its contents replaced on the post back? Move include and any other scripts outside tabs and possibly to head as a temporary measure.

jQuery selectors typically look for element IDs although can also be applied to a class or a tag. Is there a duplication of an element ID in postback content? While you can have a class applied to many elements on a page you can only have one ID referenced per page. If jQuery i looking for #tagID it wont work if there is more that one element with that ID

If you can do a VIEW SOURCE on your rendered page and attach that it should not be too much to add (as opposed to raw server source files) but it will allow me to follow the jQuery logic