使用ajax的data选项。您可以通过data
ajax中的选项将数据对象发送到服务器,并且type
定义了如何发送数据对象(POST
或GET
)。默认类型为GET
method
尝试这个
$.ajax({
url: "ajax.aspx",
type: "get", //send it through get method
data: {
ajaxid: 4,
UserID: UserID,
EmailAddress: EmailAddress
},
success: function(response) {
//Do Something
},
error: function(xhr) {
//Do Something to handle error
}
});
$_GET['ajaxid'] //gives 4
$_GET['UserID'] //gives you the sent userid
我相信在aspx中(可能是错误的)
Request.QueryString["ajaxid"].ToString();