I am using asp.net ajax version 1.0 on asp.net 2.0. (I cannot yet upgrade to 3.5)
I had a PageMethod that would get called by Javascript. This worked perfectly until I added an UpdatePanel to another part of the page. Now when I run the page with debug turned on The breakpoint in the pagemethod never gets called. when I look in firebug at what gets returned when the post to the PageMethod is called, I notice that the entire aspx page is returned instead of just the calls value. What have I done?
Here is the Javascript call to the PageMethod:
function EndRequestHandler(sender, args) {
$('#selectedCHK').change(
function() {
var chkedInput = $('#selectedCHK');
var networkRead = chkedInput[0].checked;
PageMethods.ChangeSelectedNetworkReadFlag(routeNum,
networkRead,
function(msg) { alert(msg); });
}
);
}
$(document).ready(function() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
The point of having the EndRequestHandler function called at the end of each request is that the item with the id '#selectedCHK' is inside the update panel and the event needs to get set every time the UpdatePanel is refreshed.