<div class="codetitle"> <span><a style="CURSOR: pointer" data="89225" class="copybut" id="copybut89225" onclick="doCopy('code89225')"><u>复代码码</u></a></span> 代码如下:</div> <div class="codebody" id="code89225"> <br><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 전환//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <br><html xmlns="http://www.w3.org/1999/xhtml"> <br><머리> <br><제목></제목> <br><script type="text/javascript" src="lib/jquery-1.7.2.min.js"></script> <br><script type="text/javascript"> <br>$(function () { <br>$("#btnSubmit").click(function () { <br>$.ajax({ <br>type: "post", <br>url: "Handler02 .ashx", <br>데이터: $("#frmUserInfo").serialize(), <br>성공: 함수(결과) { <br>$("#msg").html(결과); <br> } <br>}); <br><br>false 반환 <br>}); <br></script> <br></head> <br><본문> <br><form id="frmUserInfo" action="#"> <br><테이블> <br><tr> <br><td> <br>이름 <br></td> <br><td> <br><input type="text" id="txtUserName" name="txtUserName" /> <br></td> <br></tr> <br><tr> <br><td> <br>密码 <br></td> <br><td> <br><input type="password" id="txtUserPwd" name="txtUserPwd" /> <br></td> <br></tr> <br><tr> <br><td colspan="2"> <br><input type="submit" id="btnSubmit" value="提交" /> <br></td> <br></tr> <br></테이블> <br></form> <br><div id="msg"></div> <br></body> <br></html> <br><br> </div> <br><div class="codetitle"><span><a style="CURSOR: pointer" data="80939" class="copybut" id="copybut80939" onclick="doCopy('code80939')">复主代码<u></u></a> 代码如下:</span></div> <div class="codebody" id="code80939">/// <summary> ; <BR>/// 핸들러 的摘要说明 <BR>/// </summary> <br>공용 클래스 Handler02 : IHttpHandler <br>{ <br>/// <summary> <br>/// 请求处리 <br>/// </summary> <br>/// <param name="context"></param> <br>public void ProcessRequest(HttpContext context) <br>{ <br>context.Response.ContentType = "text/plain"; <br><br>// 方式2(对应表单序列化) <br>string userName = context.Request.Form["txtUserName"].ToString(); <br>string userPwd = context.Request.Form["txtUserPwd"].ToString(); <br><br>context.Response.Write(string.Format("이름:{0},密码:{1}", userName, userPwd)); <br>context.Response.End(); <br>} <br><br>public bool IsReusable <br>{ <br>get <br>{ <br> return false; <br>} <br>} <br>} <br><br> </div>