我用 url = HttpContext.Current.Request.UrlReferrer.ToString();  记录上一次访问 a 页面的url请求地址,赋予b页面中的“返回”    url中有些参数用来保存状态, 返回时,打开刚才的状态;
上图片:
搜索条件输入’女‘双击击查看详细状态此时的 ‘返回’ 连接地址变为  点击‘返回’  搜索条件变为乱码自定义控件中的搜索
 function searchValue() 
  {
      if (document.getElementById("<%=dropList_Org.ClientID %>").display == false) {
      }
      var theV=document.getElementById("<%=dropList_Org.ClientID %>").value;
      var theKeyV=document.getElementById("<%=txt_KeyValue.ClientID %>").value;
      var search = "";
      search += "?org=" + theV;      // if(theKeyV!=""&&search!="")
     if(theKeyV!="")
         search += "&key=" + document.getElementById("<%=dropList_Key.ClientID %>").value + "&keyV=" + theKeyV;
      document.location.href="qm03list.aspx"+search;  }
求解

解决方案 »

  1.   

    中文 要用Server.DelEncoding()解码 
      

  2.   

    最后那块 
    + "&keyV=" + theKeyV;
    改成
    + "&keyV=" + HttpUtility.URLEncode(theKeyV);
    然后qm03list.aspx
    对querystring 做下解码 HttpUtility.URLDecode(Request.QueryString[“keyV”])
      

  3.   

    HttpUtility.URLEncodeThe UrlEncode() method can be used to encode the entire URL, including query-string values. If characters such as blanks and punctuation are passed in an HTTP stream, they might be misinterpreted at the receiving end. URL encoding converts characters that are not allowed in a URL into character-entity equivalents; URL decoding reverses the encoding. For example, when the characters < and > are embedded in a block of text to be transmitted in a URL, they are encoded as %3c and %3e.
      

  4.   

    编码HttpUtility.URLEncode
    然后到对应接受参数的地方
    HttpUtility.URLDecode解码