前人写了以下代码,经验证有效,但是这种方法用response.write把信息写在了页面上,不和谐。我想在原提交页面弹出提示“有非法字符,请检查后再提交”,请问怎么在原提交页面弹出这样的提示?void Application_BeginRequest(object sender, EventArgs e)
{
if (Regex.IsMatch(Request.RawUrl.ToLower(), @"/manager/")==false)//不检查manager目录
     for (int i=0; i < Request.Form.Count;i++)//遍历Post参数,隐藏域除外      {
         if (Request.Form[i].ToString() == "__VIEWSTATE") continue;
         if (IsDanger(Request.Form[i].ToString()))
         {
              Response.Write("您提交的内容中含有非法字符,已经被拒绝.");
              Response.End();
          }      } }
protected bool IsDanger(string InText)
{
    string word = @"exec|insert|select|delete|update|master|truncate|char|declare|join|
iframe|href|script|<|>|request";
    if (InText == null)
        return false;
    if (Regex.IsMatch(InText,word))
         return true;
     return false;