Solved

I need Page_Load() to call inhertited Page_Load()

Posted on 2011-02-15
4
436 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I bind a WPF ComboBox to an ItemSource using XAML? 2 28
Regarding swagger API 1 32
VB.NET - Refactor Class per SOLID principles 2 33
SSIS GUID Variable 2 30
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

685 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