Locked History Actions

MyBlog/BlogEntry-2012-01-23

JQuery DatePicker and ASP.NET AJAX Update Panel

The other day I attempted to use the JQuery UI DatePicker on an ASP.NET page with an UpdatePanel. It didn't work. The root of the problem was that I assumed that my javascript to wireup the DatePicker inside of $(document)ready() would fire each time that my page posted back even for partial page updates. Apparently this is not that case. A co-worker suggested placing my code inside of the pageLoad() event to solve the problem and sure enough it did. Seconnd only to having a problem I can't solve is having a problem that is solved but not understanding why the solution works. A few days later I accidently stumbled across Dave Ward's blog post "$(document).ready() and pageLoad() are not the same! which explained the problem and solution succinctly. Its is (apparently) only one of a series of articles on JQuery and ASP.NET AJAX he has written.

The MSDN article AJAX Client Life-Cycle Events explains the source of the client side event and how it is triggered on the client side even for partial page updates.

There are are a number of replies to the post, a couple of the more interesting ones I list here: