I am writing this article is just because my long struggle for combining JQuery with Updatepanel has been completed successfully.
At initial point it wasn't working properly its because I was messing up all the wrong stuff together. It was problem neither with JQuery nor with UPdatepanel. Problem was lack of proper understanding of How UPDATE panel works.
whenever the Jquery is used within the Updatepanel creates trouble when there is asynchronous post back request triggers, and the Jquery widgets got hanged . I spent plenty of time on googling and final reached some solutions, but I must say this solution is not perfect for all the cases in which the jquery creates the problem.
what actually happen is when there is asynchronous post back. the ready function i.e.
$(document).ready(function()
{
});
not get initialized every time and this is the headache. for that we have to do certain exercise as mentioned below.
function FireOnLoad(){
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler); };
function EndRequestHandler()
{
$(document).ready(function()
{
//here goes your code....
});
}
and call this function on your page load
this works hassle free.
but still there is one problem many time it wont supply functions name to the .js file so its not firing jquery dialog event for response. uptill now I am ended up with the conclusion whenever we use update panel we have to be very careful.
Have Nice Life with Love and Joy...........
Comments
Post a Comment