<script language="javascript" type="text/javascript"> $(document).ready(function(){ $("#Button1").click(function(){ $.ajax({ type:"post", dataType:"text", url:"Handler.ashx", data:"username"+$("#Text1").val(), success:function(msg){ alert(msg); } }) }) }) </script>
ashx:
public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; string name = string.Empty; if (context.Request["username"] != null) { name = context.Request["username"].ToString(); } context.Response.Write(name); }
在这里我怎么获取不到username的值呢?
- 4 回答
- 0 关注
- 443 浏览
添加回答
举报
0/150
提交
取消