各位帮帮忙,为什么我一加Ajax控件就有乱码出现,报这个错误:
<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate>
        姓名: &nbsp;
          <asp:TextBox ID="txtUserName" runat="server"   Width="62px"></asp:TextBox>&nbsp; 
         <asp:ImageButton ID="imgbtnSearch"  ImageUrl="../App_Themes/Images/search.gif" runat="server" Width="100px" Height="21px" OnClick="imgbtnSearch_Click"  />  
       </ContentTemplate> 
        </asp:UpdatePanel>

解决方案 »

  1.   

    <globalization requestEncoding="gb2312" responseEncoding="gb2312"/> webconfing 中配置,把bg2312改成utf-8
      

  2.   


    <globalization requestEncoding="gb2312" responseEncoding="gb2312"/> webconfing 中配置,把bg2312改成utf-8
      

  3.   

    各位改成utf-8连登陆都登不了,
      

  4.   

    写一个方法,将字符串用UTF-8编码
    public static string decodeToUTF8(string str)
    {
       if(str==null)
          return null;
       str=str.trim();
       try{
           string temp=new string(str.getBytes("gb2312"),"UTF-8");
           return temp;
       }catch(Exception ex){
           return str;
       }
    }
      

  5.   

    string”并不包含“getBytes”的定义 ,这个方法怎么行啊