--前台
$.ajax({
type: "POST",
contentType: "application/json",
url: "WebForm2.aspx/GetUserName",
data: "{}",
dataType: "json",
success: function(){.......}
});
--后台
[WebMethod(EnableSession = true)]
public static string GetUserName()
{
return "123";
}
时间: 2024-11-07 12:03:06