Canceling Page.Load event

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.
 
R

Rick Strahl [MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top