Page_Init calling sequence in ASP.NET

N

Nirmalkumar

i need to create custom base class for my ASP.NET 2.0 web pages.

A : InheritsWeb.UI.Page

B : Inherits A

C : Inherits B

and then all my web pages extends/Inherits custom base class 'C'.

now i need to write page_Init in class 'B' and 'C' .

Please help me how to write page_Init method in the above Scenario.

If you people have any reference code, where custom base class is used in ASP.NET 2.0. let me kno

From http://developmentnow.com/g/8_2006_11_0_7_0/dotnet-framework-aspnet.ht

Posted via DevelopmentNow.com Group
http://www.developmentnow.com
 
G

Guest

place all three (A, B & C) in your App_Code folder and modify your web.config
as follows:

<system.web>
...
<pages pageBaseType="PageC">
...

this way all your pages will be forced to inherit from C

I did not understand the question/problem about writing Page_Init. If you
need to control the order of code execution, use OnInit override, otherwise
just place Page_Init into your classes (assuming that AutoEventWireup is set
to true) or hook it up in the classes' constructor.
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top