Page_Init calling sequence in ASP.NET

Discussion in 'ASP .Net' started by Nirmalkumar, Aug 6, 2007.

  1. Nirmalkumar

    Nirmalkumar Guest

    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
     
    Nirmalkumar, Aug 6, 2007
    #1
    1. Advertising

  2. 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.

    "Nirmalkumar" wrote:

    > 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 know
    >
    > From http://developmentnow.com/g/8_2006_11_0_7_0/dotnet-framework-aspnet.htm
    >
    > Posted via DevelopmentNow.com Groups
    > http://www.developmentnow.com
    >
     
    =?Utf-8?B?U2VyZ2V5IFBvYmVyZXpvdnNraXk=?=, Aug 6, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Kristiansen

    Page_Load or Page_Init

    Patrick Kristiansen, Mar 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    597
    Patrick Kristiansen
    Mar 5, 2004
  2. Guest
    Replies:
    2
    Views:
    560
    Natty Gur
    Jul 13, 2003
  3. Guest
    Replies:
    2
    Views:
    3,111
    Guest
    Jul 16, 2003
  4. Christian

    Page_Init() and Page_Load()

    Christian, Jul 16, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    680
    Cristian Suazo
    Jul 16, 2003
  5. stef mientki
    Replies:
    13
    Views:
    649
    stef mientki
    Oct 20, 2007
Loading...

Share This Page