有两张页面,from.aspx和to.aspx
from.aspx?abc="中华人民共和国"
当在to.aspx,Request取abc值时,出现
"中华人民共和?"
这是什么问题呀?

解决方案 »

  1.   

    传输中文字符串时,建议先UrlEncode,在接收方使用UrlDecode
      

  2.   

    saucer(思归) 大哥,具体怎样用呀?
      

  3.   

    from.aspx?abc=server.urlencode("中华人民共和国")to.aspx
    response.write(server.urldecode(request.querystring("abc"))
      

  4.   

    from.aspx里面有一张DataGrid1,
    有一个字段是链接
    to.aspx?dwbm={0}
    dwbm的值是中文,
      

  5.   

    System.Web.HttpUtility.UrlEncode("要编码的文本",System.Text.Encoding.GetEncoding("gb2312"));
    System.Web.HttpUtility.UrlDecode("要解码的文本",System.Text.Encoding.GetEncoding("gb2312"));
      

  6.   

    gb2312编码会短一点,不过utf-8更通用。
      

  7.   

    from.aspx?abc=server.urlencode("中华人民共和国")我在这里to.aspx?dwbm={0}怎样写server.urlencode呀。
      

  8.   

    我是在表格的《属性生成器》加了超级链接列来传值的,
    不知道怎样在《URL格式字符串》中写to.aspx?dwbm={0},
      

  9.   

    1. UrlEncode the data before databinding2. change HyperLinkColumn to <asp:TemplateColumn>
     <ItemTemplate>
    <asp:HyperLink runat="server" NavigateUrl='<%# String.Format("to.aspx?dwbm={0}", Server.UrlEncode(....))%>' />
     <ItemTemplate>
    </asp:TemplateColumn>
      

  10.   

    把配置文件改用gb2312编码马上就行了。免得到处打System.Web.HttpUtility.UrlEncode("要编码的文本",System.Text.Encoding.GetEncoding("gb2312"));
    这种代码