页面有<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;请问是何原因....

解决方案 »

  1.   

    有一点要补充的VALUE是邦定的
    <input id="RPpagecount" name="ccc" type="text" value="<%=RPpagecount %>" />
      

  2.   

    submit()就是提交,等同于.net postback
    如果是type="button" 类型的input标签就要利用submit()实现提交
    如果是type="submit" 类型的Input标签就不需要
    通过submit()才能把表单的内容提交出去
    Request.Form["..."] 获取以post的方式提交的数据
    由于没发生提交操作
    所以
    string pcount = Request.Form["ccc"];//pcount=null;
      

  3.   

    <a onclick="javascript:location.href='receive.aspx?currentpage=4';return false;" title="第4页" href="#">4</a>
    我是以A标签提交的。提交传一个页码值,并判断页码值不能大于总页码Request.Form["ccc"],就是取总页码老取不了
      

  4.   

    刚测试了下,的确如二楼和楼上所说。只有location.href,并没有提交,那现在我的提交形式是以下这样的A标签,请问如何实现提交(在后台可以取值),谢谢。<a onclick="javascript:location.href='receive.aspx?currentpage=4';return false;" title="第4页" href="#">4</a>