刚刚写了个静态方法:
private static HttpContext context = HttpContext.Current;
public static void PopMsg(MsgType type)
  {
   string msg = GetMsg( type );
      
   string script = "<script language='javascript'>alert('" +
    msg + "')</script>";
   
    //HttpContext.Current.Response.Write(script);
   context.Response.Write(script);
  }

第一次提交可以,第二次调用PopMsg就报错了:
将context.Response.Write(script);改为HttpContext.Current.Response.Write(script);就OK了,
记下,待研究
值不能为空。参数名: destination

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.ArgumentNullException: 值不能为空。参数名: destination

源错误:

相关文章:

  • 2021-05-16
  • 2021-08-04
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2021-09-27
猜你喜欢
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2021-09-19
相关资源
相似解决方案