interviews.dotnetthread.com

↑ Grab this Headline Animator

Friday, July 3, 2009

Alternative: $(document).ready handler will not be fired on asynchronous postback.

Like in case we are using updatepanel under which we have postback button along with jQuery calender textbox.

And datepicker is attached to a textbox in document ready event handler.

Upon postback jquery calender will not work as $(document).ready will not be called on
asynchronous postback
so to make sure this to work we have to call a Javascript function after an UpdatePanel asynchronous postback using the following line


Sys.WebForms.PageRequestManager.getInstance().add_endRequest(showdatepicker);


here showdatepicker is a function which will attach jQuery datepicker to a textbox.

Submit this story to DotNetKicks

2 comments:

moi said...

What about using pageLoad() ?

anil said...

hi moi

page_load will be called in this case problem is with $(document).ready

Post a Comment

Post your comments/questions/feedback for this Article.

 

Latest Articles