Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 03, 2010 08:06 AM by gt1329a
Jul 01, 2010 11:19 PM|LINK
I have a highly customized page that uses about 3 update panels. I am just starting to integrate some jQuery(), but I'm not sure how to implement any function that needs to be called within the $().ready(callback) .
I would prefer to write this code server-side and have it propagate to client-side. Basically, I mean that I would like to use the ScriptManager to Execute my script.
I have seen a couple things online, but I have not really gotten anything to work.
I have tried code similar to
http://blog.dreamlabsolutions.com/post/2009/02/24/jQuery-document-ready-and-ASP-NET-Ajax-asynchronous-postback.aspx . but with no success. I wrote this code in the middle of a web-user control and nothing ever seemed to get called.
I also read that you can just put the callback code from ready() within the RegisterStartupScript() code blocks. I did not have success with this either. I get errors thrown in ScriptResource.asx (or something like that).
Is there something I'm missing?
Jul 02, 2010 06:41 AM|LINK
post some code please ??
Jul 03, 2010 03:34 AM|LINK
$().ready() is the jquery version ScriptManager.RegisterStarupScript.
if your jQuery binds to controls in the update panel, then you need to rebind after an update. you shoudl also unbind the old controls or you wll have a memory leak.
if you are using an update panel, you can also register your jquery with the ms ajax client events handles see PageManager. these routines are a lot harder then jquery though. If you are using jQuery I'd drop the update panel and use the jQuery version.
Jul 03, 2010 08:06 AM|LINK
$(document).ready() plays well with the ScriptManager and UpdatePanel. No reason to avoid it.