Page_Init calling sequence in ASP.NET

  • Thread starter Thread starter Nirmalkumar
  • Start date Start date
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
 
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.
 
Back
Top