first is the the element you are attaching the click to in the update panel? if so you need to rebind the click handler in the endHandler (so it will work on a click). you should also unbind the old handler or you will have a memory leak (the browser can
not release the element because of a reference to it).
second is the results in the update panel? if so you need to scroll in the endhandler after its rendered. you will need a flag (the Sys.Weforms class is not well designed for this case).
Yes everything is taking place in the update panel. The button and the results are inside of the panel. I'm not sure I exactly follow you on what your suggesting though based on my level of understanding of the whole process. Would you be willing to share
an example or a source for what you are referring to? I tried the following, but I think I'm just doing it all wrong and I have no idea how to work the flag you mentioned to check rendering.
$(document).ready(function() {
$("#AssessmentItemFilter1_continuemultiple").click(function() {
goToByScroll('#tableResults');
});
var pgRegMgr = Sys.WebForms.PageRequestManager.getInstance();
pgRegMgr.add_endRequest(EndHandler);
});
function EndHandler() {
var handler = function() {
goToByScroll('#tableResults');
}
$('#AssessmentItemFilter1_continuemultiple').unbind('click', handler);
$("#AssessmentItemFilter1_continuemultiple").click(function() {
goToByScroll('#tableResults');
});
}
cweiz32
Member
1 Points
14 Posts
Re: maintaining jquery click function in update panel through PageRequestManager
May 03, 2010 12:38 AM|LINK
Yes everything is taking place in the update panel. The button and the results are inside of the panel. I'm not sure I exactly follow you on what your suggesting though based on my level of understanding of the whole process. Would you be willing to share an example or a source for what you are referring to? I tried the following, but I think I'm just doing it all wrong and I have no idea how to work the flag you mentioned to check rendering.
$(document).ready(function() { $("#AssessmentItemFilter1_continuemultiple").click(function() { goToByScroll('#tableResults'); }); var pgRegMgr = Sys.WebForms.PageRequestManager.getInstance(); pgRegMgr.add_endRequest(EndHandler); }); function EndHandler() { var handler = function() { goToByScroll('#tableResults'); } $('#AssessmentItemFilter1_continuemultiple').unbind('click', handler); $("#AssessmentItemFilter1_continuemultiple").click(function() { goToByScroll('#tableResults'); }); }