工作日志(DJ)

ajax传参:  $.post("MAIN_JSHandler.ashx",
                               { "retInfoCode": retobj.retInfo.Code,
                                   "retInfoMsg": retobj.retInfo.Msg,
                                   "FPInfo": escape(str),
                                   "ExtraFPInfo": retobj.Extra.FPInfo
                               },
                               function(data) {
                                   alert(1);
                               },
                               "json"
                        );

传递中文信息除了要用escape,在后台还需要用 

context.Response.ContentType = "text/plain";
            string retInfoCode = context.Request.Params["retInfoCode"];
            string retInfoMsg = context.Request.Params["retInfoMsg"];
            string FPInfo = System.Web.HttpUtility.UrlDecode(context.Request.Params["FPInfo"]);
            string message = "";
            string ExtraFPInfo = context.Request.Params["ExtraFPInfo"];

也就是System.Web.HttpUtility.UrlDecode解码,

这样就能正常使用。

 

posted @ 2014-09-19 09:09  秋日的私语(且行且珍惜)  阅读(116)  评论(0编辑  收藏  举报