Solved

I need Page_Load() to call inhertited Page_Load()

Posted on 2011-02-15
4
435 Views
Last Modified: 2012-05-11
I have a class, Site, that I want to inherit from. And I want Site.Page_Load() to perform some authentication.  But I don't know how to make the child's Page_Load() call Site.Page_Load().

It's

base.Page_Load() does not appear in IntelliSense.

What am I missing?

newbieweb
0
Comment
Question by:newbieweb
4 Comments
 
LVL 9

Assisted Solution

by:gdupadhyay
gdupadhyay earned 100 total points
ID: 34898475
See this URL, might be help you.
http://forums.asp.net/p/1601418/4076577.aspx#4076577
0
 
LVL 16

Accepted Solution

by:
ToddBeaulieu earned 200 total points
ID: 34898936
I read your question as you're actually subclassing a page, rather than using popups.

If that's correct, here is a discussion on it, as well as a "gotcha" on the order of events (and a fix).

You wouldn't invoke the parent's Page_Load, as it's an event, not a method. Sure, it's sunk with a method, but it's an event. Anyway, this example shows how to do this:

http://www.15seconds.com/issue/060413.htm
0
 
LVL 16

Assisted Solution

by:BurnieP
BurnieP earned 200 total points
ID: 34902201
If it is inherited, you should be able to call base.OnLoad(e);

protected void Page_Load(object sender, EventArgs e) {
      base.OnLoad(e);
}
0
 

Author Closing Comment

by:newbieweb
ID: 34916400
Thanks!
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question