ASP.NET中Ajax怎么使用

2016-12-08 15:50:37  asp.netajax

在ASP中应用Ajax的格式如下:

前台代码(用JQuery库)

$.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中Ajax使用方法的相关知识,希望对大家有所帮助,如果大家想了解更多内容,敬请关注网站!

ASP.NET中Ajax怎么使用》阅读地址:http://www.haoshilao.net/12976/

最新图文教程: