页面有<input id="RPpagecount" name="ccc" type="text" value="12" />
如果下面这样,后台无法取值
document.location = "../letter/receive.aspx?currentpage=" + GOtopage.value;
string pcount = Request.Form["ccc"];//pcount=null;
如果下面这样,后台可以正确取值
myform.action = "../letter/receive.aspx?currentpage=" + GOtopage.value;
myform.submit();
string pcount = Request.Form["ccc"];//pcount=12;请问是何原因....
如果下面这样,后台无法取值
document.location = "../letter/receive.aspx?currentpage=" + GOtopage.value;
string pcount = Request.Form["ccc"];//pcount=null;
如果下面这样,后台可以正确取值
myform.action = "../letter/receive.aspx?currentpage=" + GOtopage.value;
myform.submit();
string pcount = Request.Form["ccc"];//pcount=12;请问是何原因....
解决方案 »
- 图片显示问题?
- 网站测试小问题 The connection was not closed ……
- 从字符串转换为 smalldatetime 数据类型时发生语法错误.请高手指点。
- 帮忙看下面一句JS,怎么老报错:“缺少对象”
- RequiredFieldValidator的问题?
- 高分在线等待ASP.NET树型结构问题
- Sharepoint Services如何注册Webpart,在线急等!
- 未能加载文件或程序集
- 怎么样取得http://192.168.1.0/AA/BB/Index.aspx的192.168.1.0/AA??
- 小问题,给分!
- 还是不明白
- 关于SqlCommand参数化存储过程的问题。急啊
<input id="RPpagecount" name="ccc" type="text" value="<%=RPpagecount %>" />
如果是type="button" 类型的input标签就要利用submit()实现提交
如果是type="submit" 类型的Input标签就不需要
通过submit()才能把表单的内容提交出去
Request.Form["..."] 获取以post的方式提交的数据
由于没发生提交操作
所以
string pcount = Request.Form["ccc"];//pcount=null;
我是以A标签提交的。提交传一个页码值,并判断页码值不能大于总页码Request.Form["ccc"],就是取总页码老取不了