在类文件中使用Response,今天又遇到同样的错误。

1。要在项目中引用System.Web

2.

        public static void Break(string ErrInfo)
        
{
            System.Web.HttpContext.Current.Response.Write (
"<script>alert(\'" + ErrInfo + "\');history.back();<" + "/script>");
            System.Web.HttpContext.Current.Response.End();
        }
原文地址:https://www.cnblogs.com/zkxp/p/331183.html