In the page_load of page A I Server.Transfer to Page B (Server.Transfer("B.aspx");)
Then on page B I have a simple html button that has the onclick="ajaxFunction();";
function ajaxFuntion()
{
$.ajax({
type: "POST",
url: "B.aspx/MyPageMethod",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
async: false,
cache: false
});
}
I get ajax error "Method not Found"
When I use Repsonse.Redirect instead of Server.Transfer, it works. But I need to use Server.transfer. Is there a fix here?
Thx