在js里我用下面语句传值
obj.onreadystatechange = processResponse;
obj.open("Get","http://localhost/LabManageSystem/Forum/saveXML.aspx?  newmessage="+message+"&username="+user,true);
然后在ASP.net里用
   string message = Request.QueryString["newmessage"];
   string username = Request.QueryString["username"];
取值
但只可以传取英文,不可以传取中文,为什么啊?请帮帮忙!谢谢..

解决方案 »

  1.   

    URL传中文很痛苦的,
    要先编码,然后在另外一端解码.
    如果能够不传的话,尽量不传或者用其它方式.
    以前的帖子:
    http://topic.csdn.net/t/20060329/15/4648673.html
      

  2.   

    URLEncoder ,escape  都可以。当是这两个编码都是针对UTF8的编码。如果是gb2312的话,还有点麻烦
      

  3.   

    obj.open("Get","http://localhost/LabManageSystem/Forum/saveXML.aspx?newmessage="+escape(message)+"&username="+escape(user),true); 
      

  4.   

    方法有很多种。1>修改web.config  <globalization requestEncoding="gb2312" />2>客户端对中文进行编码 escape, URLEncoder3>服务器端对中文进行编码: Server.UrlEncode("中国");Request.QueryString[Key]的时候不需要解码,会自动解码。
      

  5.   


    newmessage="+escape(message)+"&username="+(user)escape() 方法