在index.aspx中js如下<script language="javascript">
<!--
function log(){
if ((document.all.uname.value=='')||(document.all.pwd.value=='')){
alert("请输入用户名和密码!");
return false;
}
else{

var str;
str="login.aspx?uname=" + document.all.uname.value + "&url1=" + window.location.href;
location.href = str;
return true;
}
}
</script>
我在login.aspx中 request.querystring(uname)有值,为什么request.querystring(url1)为空

解决方案 »

  1.   

    将你的location.href在客户端编一下码,再传到服务器
      

  2.   

    str="login.aspx?uname=" + document.all.uname.value + "&url1=" + window.location.href;
    -->
     str="login.aspx?uname=" + document.all.uname.value + "&url1="+document.URLUnencoded(window.location.href)
      

  3.   

    用escape()试试str="login.aspx?uname=" + document.all.uname.value + "&url1=" + escape(window.location.href);
      

  4.   

    为什么在login.aspx request.querystring(url1)时,还是为空
      

  5.   

    in c#WebForm2.aspx<input type="button" name="test" runat="server" onclick="test_fun()" value="test"><script language="javascript" >
    function test_fun()
    {
    var str_value='';
    str_value='WebForm1.aspx?name=abc&urll='+escape(window.location.href);
    window.location.href=str_value;
    }
    </script>---------------------------------------------------------------------------
    WebForm1.aspxprivate void Page_Load(object sender, System.EventArgs e)
    {
    // 在這裡放置使用者程式碼以初始化網頁
    Response.Write(Request.QueryString.Get(0));
    Response.Write("<br>");
    Response.Write(Request.QueryString.Get(1)); }
    ---------------------------------------------
    Is not null!!!