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();
}
{
System.Web.HttpContext.Current.Response.Write ("<script>alert(\'" + ErrInfo + "\');history.back();<" + "/script>");
System.Web.HttpContext.Current.Response.End();
}