$.ajax({ type: "POST", async: true, url: "../Ajax/ajax.ashx", dataType: "html", data: null success: function (result) { //do successful sth }, error: function (XMLHttpRequest, textStaus, errThrown) { //do error sth }})Ajax(一般性处理程序)中代码如下:
public void ProcessRequest (HttpContext context) {context.Response.ContentType = "text/plain";string result = "Hello World";context.Response.Write(result);}以上所述是小编给大家介绍的ASP.NET中Ajax使用方法的相关知识,希望对大家有所帮助,如果大家想了解更多内容,敬请关注脚本之家网站!