我有一行代码:
Label.Text="<A href='answer.aspx?id="+Server.UrlEncode("我的电脑--外星人")+"'>请点击</A>"
当我单击按钮时出现http://localhost/answer.aspx?id=%e6%88%91%e7%9a%84%e7%94%b5%e8%84%91--%e5%a4%96%e6%98%9f%e4%ba%ba
在answer.aspx页面在用Request.Params["id"]接收不下来参数,还有就是如何把那些乱码还原出来。
救命啦!!

解决方案 »

  1.   

    Label.Text="<A href='answer.aspx?id="+System.Web.HttpUtility.UrlEncode("我的电脑--外星人", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()+"'>请点击</A>"看看,应该可以
      

  2.   

    Request.QueryString["id"]
    Request.QueryString["id"]
    Request.QueryString["id"]
      

  3.   

    net_lover老兄的我试过了,只是把地址段的代码变成大写了,没有其它变化
    另外两位老兄也试过,没有任何变化
    还是谢谢你们,有没有做过的,把代码传上来参考一下
      

  4.   

    http://jhtchina.cnblogs.com/archive/2005/02/23/108152.html
      

  5.   

    提交的时候使用了Server.UrlEncode,获取的时候用Server.UrlDecode还原
      

  6.   

    楼主把
        <globalization 
                requestEncoding="GB2312" 
                responseEncoding="GB2312" 
       />
    改为:
        <globalization 
                requestEncoding="UTF-8" 
                responseEncoding="UTF-8" 
       />
    在试试
      

  7.   

    我用Label.Text=Request.QueryString["id"]发现Label控件什么也不显示
    是不是Request.QueryString["id"]没有接收到参数?
      

  8.   

    按fphuang兄弟的做过,还是不行。
      

  9.   

    试试先编码,
    HttpUtility.UrlEncode 方法
    后解码。
    HttpUtility.UrlDecode 方法
      

  10.   

    http://www.cnblogs.com/renyu732/archive/2005/06/09/171175.html
      

  11.   

    to:mmiao(阿呆) 
        你的分析是有道理的,先看看Request.QueryString["id"]这个是否可以接收到数据,this.Response.Write(Request.QueryString["id"].Tostring());看看有没有什么东西,从前我也遇到过这样的问题,不过
    Server.UrlEncode()
    Server.UrlDecode()
    也就好了。你再查查吧,
      

  12.   

    Label.Text="<A href='answer.aspx?id="+System.Web.HttpUtility.UrlEncode("我的电脑--外星人", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()+"'>请点击</A>"看看,应该可以Label.Text="<A href='answer.aspx?id="+System.Web.HttpUtility.UrlEncode("我的电脑--外星人", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()+"'>请点击</A>"看看,应该可以Label.Text="<A href='answer.aspx?id="+System.Web.HttpUtility.UrlEncode("我的电脑--外星人", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()+"'>请点击</A>"看看,应该可以Label.Text="<A href='answer.aspx?id="+System.Web.HttpUtility.UrlEncode("我的电脑--外星人", System.Text.UnicodeEncoding.GetEncoding("GB2312")).ToUpper()+"'>请点击</A>"看看,应该可以
      

  13.   

    这个问题我也遇到过,通过超级链接传参数可以直接传中文参数,只不过在该超级链接所在的页面需要把该页面document的charset属性设为空,就可以正常传中文参数.
      

  14.   

    可能是编码问题,试试UTF-8和GB2312换换