1、首先,js中,进行URL编码(使用escape)

 2、一般处理程序或.ASPX接收页面进行接收参数并解码,使用(context.Server.UrlDecode)

//学年
string strSchoolYear = context.Server.UrlDecode(context.Request.QueryString["SchoolYear"]);
//学期
string strSemester = context.Server.UrlDecode(context.Request.QueryString["Semester"]);
    LogHelp logHelp = new LogHelp();//日志记录帮助类
    public void ProcessRequest(HttpContext context)
    {

        context.Request.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";
        //邮件信息
        returnMail data = null;
        JavaScriptSerializer js = new JavaScriptSerializer();
        logHelp.WriteLog("接受参数成功,mailObj==>" + context.Request.QueryString["mailObj"]);
        if (!string.IsNullOrEmpty(context.Request.QueryString["mailObj"]) && context.Request.QueryString["mailObj"] != "null")
        {
            data = js.Deserialize<returnMail>(context.Request.QueryString["mailObj"]);
       string senderName=context.Server.UrlDecode(data.senderName)
        }
  }

 



相关文章:

  • 2022-12-23
  • 2021-08-06
  • 2021-06-02
  • 2021-05-12
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2022-01-24
  • 2021-08-23
  • 2022-02-18
  • 2021-08-10
相关资源
相似解决方案