您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

Asp.net Jquery Ajax 实例

2024/12/26 14:19:42发布20次查看
jquery 库最新版下载:jquery-1.4.2min.js
jquery 1.3.2mini版:jquery-1.3.2min.js
中文手册下载地址(超酷版):jquery12api
前台代码:
<%@ page language="c#" autoeventwireup="true" codefile="ajax.aspx.cs" inherits="ajax" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>jquery ajax实例</title> <mce:script type="text/<a href="http://lib.csdn.net/base/javascript" class='replace_word' title="javascript知识库" target='_blank' style='color:#df3434; font-weight:bold;'>javascript</a>" src="script/jquery-142min.js" mce_src="script/jquery-142min.js"></mce:script> <mce:script type="text/javascript"><!-- $(function() { $("#dbtn").click(function(){ $.ajax({ type: "post", //datatype:"text", url:"handler.ashx", data:{name:"admin",pass:"admin"}, beforesend:function(){ $("#ds").html("loading"); }, success: function(msg){ $("#ds").html("<p>"+msg+"</p>"); } }); }); }); // --></mce:script> </head> <body> <form id="form1" runat="server"> <div> <div id="ds"><p>我是ajax原来的文字!</p></div> <input type="button" value="提交ajax<a href="http://lib.csdn.net/base/softwaretest" class='replace_word' title="软件测试知识库" target='_blank' style='color:#df3434; font-weight:bold;'>测试</a>" id="dbtn" name="dbtn" /> </div> </form> </body> </html>
handler.ashx:
<%@ webhandler language="c#" class="handler" %> using system; using system.web; using system.data.sqlclient; public class handler : ihttphandler { public void processrequest (httpcontext context) { context.response.contenttype = "text/plain"; //context.response.write("hello world"); if (context.request["name"].tostring() == "admin" && context.request["pass"].tostring() == "admin") { context.response.write("y"); } else { context.response.write("n"); } } public bool isreusable { get { return false; } } }
更多asp.net jquery ajax 实例关文章请关注!
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product