Canceling Page.Load event

  • Thread starter Thread starter AT
  • Start date Start date
A

AT

I have an aspx page with this code behind

Public Class WebForm1
Inherits Class1

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Derived
Return
End Sub

End Class

And a Class

Public Class Class1
Inherits System.Web.UI.Page

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' Base
Return
End Sub

End Class

When asp page is loaded base event fires first. Then derived class event
fires.
How can I conditionally prevent derived class Page_Load event from firing?

Thanks.
 
AT,

You really can't. If you need to do this you need to really review your
design - a lower level class shouldn't have to make decisions about whether
and how higher level methods operate.

You can of course do a REsponse.End() to cancel all operation, which is a
brute force way of doing things...

+++ Rick ---

--

Rick Strahl
West Wind Technologies
www.west-wind.com
www.west-wind.com/weblog
 
Back
Top