如何解决在jquery post 传选中的下拉菜单的值过程中出现错误
如题:运用jquery post方法箱动态把选中的下拉菜单的一个选中的值传送到处理页面,可是在接收页面的值却始终是null,昨天花了一下午的时间,找遍了网上的大部分方式,然后进行尝试,都没有解决,麻烦各位老师帮忙看看,用你们的经验看看代码哪里出现了问题。上代码。
主页面:
<script language="javascript" type="text/javascript"> $(function(){ $("#Button1").click(function(){ $.post("text.aspx",{Action:"post",catagory:$("#selectType1").val()}, function(data){ $("#mydiv").html( data ); },"text"); }); }); </script><form id="form1" runat="server"> <select id="selectType1" name="selectType1" style="width: 100px;"> <option value="已报班">已报班</option> <option value="未报班">未报班</option> <option value="全部">全部</option> </select> <div><input id="Button1" type="button" value="提交" style=" float:left;"/></div> <div id="mydiv"></div></form>
protected void Page_Load(object sender, EventArgs e) { [color=#800000][b]string catagory = Request.Form[/b]["catagory"][/color]; Response.ContentType = "text/plain"; if(catagory !=){ Context.Response.Write("success"); }else{Context.Response.Write("fail"); } Response.End(); }