怎样取消Application_EndRequest中的输出?
protected void Application_EndRequest(Object sender, EventArgs e)
{
//每页都输出,但有个别的不希望输出,在WebForm.aspx.cs中怎样用代码取消?同样的在Application_BeginRequest中的又怎样取消?
  Response.Write("EndRequest"); } 谢谢。

解决方案 »

  1.   

    没页,这个应该是Global.asax中的吧,
      

  2.   

    是啊,该程序下的webform都会在末端输出endrequest.怎样取消输出。
      

  3.   

    如果不符合特定页面地址不输出应该就可以了吧
    protected void Application_EndRequest(Object sender, EventArgs e)
    {
    string [] s=((HttpApplication)sender).Request.Url.ToString().Split('/');
    if(s[s.Length-1].ToString().ToLower()!="webform.aspx")Response.Write("EndRequest");
    }
      

  4.   

    如果想在各个页面控件Application_EndRequest的输出显示不可能,但却可以在Application_EndRequest事件里面针对单独页面做处理.方法如楼上.
      

  5.   

    这样加endrequest中的负担了。真的没有办法了吗?谢谢楼上两位。