问题
How to call page method from jquery without using scriptmanager
回答1:
You can do it this way
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: "json",
url: "webpage.aspx/methodName",
data: "{id: '" + id + "'}",
success: getTargetSuccess,
error: getTargetFailure
});
function getTargetSuccess(result,e)
{
var data = result.d;
}
function getTargetFailure(result,e)
{ }
回答2:
Excellent guide here: http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/
来源:https://stackoverflow.com/questions/5325721/call-page-method-without-script-manager-from-jquery