日期:2014-05-17  浏览次数:20456 次

.ashx接收参数出现乱码问题...急等解决!!!
.ashx后台:
 
 public void ProcessRequest(HttpContext context)
        {
            
            context.Request.ContentEncoding = Encoding.GetEncoding("gb2312");
            context.Response.ContentType = "text/plain";
                       if (context.Request.Form["_type"] != null)
            {
                switch (context.Request.Form["_type"])
                {
                    case "_AllPageNum": SendAllPageNum(context); break;
                                      default: break;
                }
            }
        }


   private void SendAllPageNum(HttpContext context)
        {
            string TableName = context.Request.Form["_TableName"];
            string SelectWhere = context.Request.Form["_SelectWhere"];                 }


string SelectWhere = context.Request.Form["_SelectWhere"] 页面输入的是汉字,但是传过来
就成了乱码le

------解决方案--------------------