HyperLink h = new HyperLink();
h.Text = "中文"; 
h.Attributes.Add("href","aa.aspx?name=中文");
this.tdAttach.Controls.Add(h);
当我在aa.aspx接收的时候接收到的name值是一个乱码,我想不对上面做大的修改,假如能实现
h.Attributes.Add("href","aa.aspx?name=escape('中文')");
这样的效果最好

解决方案 »

  1.   

    web.config的<system.web>节点下配置
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN"/>
      

  2.   


    h.Attributes.Add("href","aa.aspx?name="+Server.UrlEncode("中文"));
    转码一下再传
      

  3.   

    试试这样
     HyperLink h = new HyperLink();
                h.Text = "中文";
                string value = "中文";
                h.Attributes.Add("href", "test.aspx?name=" + Server.UrlPathEncode(value));
                this.tdAttach.Controls.Add(h);
      

  4.   

    js中用escape(中文) 做个编码
      

  5.   

    Response.Redirect("B.aspx?Name="+Server.UrlEncode("中文")) ;接收:string Name = Server.UrlDecode(Request.QueryString["Name"].ToStrong()); 
      

  6.   

    设置web.config
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN"/>
      

  7.   

    +1
     h.Attributes.Add("href", "test.aspx?name=" + Microsoft.JScript.GlobalObject.escape("中文"));
    这样试试  是否可以。