手机
当前位置:查字典教程网 >编程开发 >asp.net教程 >ASP.NET中Ajax怎么使用
ASP.NET中Ajax怎么使用
摘要:在ASP.NET中应用Ajax的格式如下:前台代码(用JQuery库)$.ajax({type:"POST",async:true,url:...

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

【ASP.NET中Ajax怎么使用】相关文章:

ASP.NET2.0中数据源控件之异步数据访问

ASP.NET中的URL映射技巧

ASP.NET中Global和URLReWrite用法

ASP.NET常用代码

ASP.NET编程中的十大技巧

在ASP.NET2.0中通过Gmail发送邮件的代码

在ASP.NET 中实现单点登录

ASP.NET 2.0 中的创建母版页

在ASP.NET中使用Session常见问题集锦

ASP.NET中为DataGrid添加合计字段

精品推荐
分类导航