Not thinking, everytime I double clicked the form to get to the
codebehind, the default action of the form control was re-creating the
event handler for the page load method. Instead of handling the event
in the base class, I am handling it on the client, and that seems to
be working fine, as long as I make a call to MyBase.Page_Load.
Thanks!
"Greg Burns" <greg_burns@DONT_SPAM_ME_hotmail.com> wrote in message news:<(E-Mail Removed)>...
> Why do you want to do this? I just played with a BasePage for the first
> time yesterday. I wanted all my pages to run the same code in Page_Load, so
> I added it to a BasePage class. Each derived class still has their own
> Page_Load events that runs. Why don't you want the derived classes's
> Page_Load events to run? Can't you just leave the event empty?
>
> Or am I just missing what you are trying to do? :^)
>
> Here is my BasePage class:
>
> Public Class BasePage
> Inherits Page
>
> Private Sub Page_Load(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles MyBase.Load
>
> Response.Cache.SetCacheability(HttpCacheability.NoCache)
>
> End Sub
> End Class
>
> PS: In the future I would post to microsoft.public.dotnet.aspnet group.
>
> Greg
>
> "Justin Beckwith" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hey all, to keep some common functionality together, I am making all
> > of my web forms inherit from one base class, which inherits from
> > System.Web.UI.Page, instead of all my webforms inheriting
> > System.Web.UI.Page. To inherit the base class, my page load method
> > should NOT handle the base class event, since the method I am
> > overloading in the base class handles the page load event. So I
> > deleted the event handler, and all was working well. However, when I
> > close and re-open the web form in Visual Studio, it appends the
> > "Handles MyBase.Load" clause to the end of my Page_Load method. Has
> > anyone ever run into this before?
|