Help me out: ASP.Net BUG: Page_Load event not called!

Discussion in 'ASP .Net' started by =?Utf-8?B?TkdN?=, Jan 29, 2004.

  1. Hello All,

    From one week rather developing any code i have been discovering BUGS in asp.net,
    Please help me out on this!

    I have class say 'Handler' which inherits System.Web.UI.Page,
    and i have put in a seperate DLL,

    The code is show below:

    using System;
    using System.Web;
    namespace FCTest1
    {
    public class Handler : System.Web.UI.Page
    {
    protected override void OnLoad(EventArgs args)
    {
    }
    }
    }

    Now i inherit by wepage class from 'Handler' class instead of System.Web.UI.Page (it does not make a difference as Handler class inherits from System.Web.UI.Page)

    Here is the simple code:

    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using FCTest1;

    namespace FCWebTest1
    {
    public class WebForm1 : FCTest1.Handler
    {
    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the page here
    int i = 1; //<----- Control never reaches here!!! Help me out please!
    Response.Write("Hello");
    }
    }
    }

    Now the problem is the Page gets loaded and the Page_Load never gets called!!!, the control simply does not reach there at all!!!!

    Is this a BUG?? is there any workaround for this???

    Please help me out asap!

    I really in need of solutions, you can mail me at :

    Thanks in advance
    NGM
    =?Utf-8?B?TkdN?=, Jan 29, 2004
    #1
    1. Advertising

  2. =?Utf-8?B?TkdN?=

    Sam Fields Guest

    You didn't accidently remove the:

    this.Load += new System.EventHandler(this.Page_Load);

    from the InitializeComponent() method in the web form designer generated
    code, did you?

    Hope this helps.
    Sam

    "NGM" <> wrote in message
    news:...
    > Hello All,
    >
    > From one week rather developing any code i have been discovering BUGS in

    asp.net,
    > Please help me out on this!
    >
    > I have class say 'Handler' which inherits System.Web.UI.Page,
    > and i have put in a seperate DLL,
    >
    > The code is show below:
    >
    > using System;
    > using System.Web;
    > namespace FCTest1
    > {
    > public class Handler : System.Web.UI.Page
    > {
    > protected override void OnLoad(EventArgs args)
    > {
    > }
    > }
    > }
    >
    > Now i inherit by wepage class from 'Handler' class instead of

    System.Web.UI.Page (it does not make a difference as Handler class inherits
    from System.Web.UI.Page)
    >
    > Here is the simple code:
    >
    > using System.Web.UI;
    > using System.Web.UI.WebControls;
    > using System.Web.UI.HtmlControls;
    > using FCTest1;
    >
    > namespace FCWebTest1
    > {
    > public class WebForm1 : FCTest1.Handler
    > {
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > // Put user code to initialize the page here
    > int i = 1;

    //<----- Control never reaches here!!! Help me out please!
    > Response.Write("Hello");
    > }
    > }
    > }
    >
    > Now the problem is the Page gets loaded and the Page_Load never gets

    called!!!, the control simply does not reach there at all!!!!
    >
    > Is this a BUG?? is there any workaround for this???
    >
    > Please help me out asap!
    >
    > I really in need of solutions, you can mail me at :
    >
    > Thanks in advance
    > NGM
    >
    Sam Fields, Jan 29, 2004
    #2
    1. Advertising

  3. =?Utf-8?B?TkdN?=

    Marina Guest

    Your OnLoad in the base class doesn't do anything. If it doesn't call
    base.OnLoad, then the Load event won't happen. And if the Load event doesn't
    happen, you can't expect any handlers for it to fire.

    You should be careful about overriding methods if you don't really
    understand how they work.

    "NGM" <> wrote in message
    news:...
    > Hello All,
    >
    > From one week rather developing any code i have been discovering BUGS in

    asp.net,
    > Please help me out on this!
    >
    > I have class say 'Handler' which inherits System.Web.UI.Page,
    > and i have put in a seperate DLL,
    >
    > The code is show below:
    >
    > using System;
    > using System.Web;
    > namespace FCTest1
    > {
    > public class Handler : System.Web.UI.Page
    > {
    > protected override void OnLoad(EventArgs args)
    > {
    > }
    > }
    > }
    >
    > Now i inherit by wepage class from 'Handler' class instead of

    System.Web.UI.Page (it does not make a difference as Handler class inherits
    from System.Web.UI.Page)
    >
    > Here is the simple code:
    >
    > using System.Web.UI;
    > using System.Web.UI.WebControls;
    > using System.Web.UI.HtmlControls;
    > using FCTest1;
    >
    > namespace FCWebTest1
    > {
    > public class WebForm1 : FCTest1.Handler
    > {
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > // Put user code to initialize the page here
    > int i = 1;

    //<----- Control never reaches here!!! Help me out please!
    > Response.Write("Hello");
    > }
    > }
    > }
    >
    > Now the problem is the Page gets loaded and the Page_Load never gets

    called!!!, the control simply does not reach there at all!!!!
    >
    > Is this a BUG?? is there any workaround for this???
    >
    > Please help me out asap!
    >
    > I really in need of solutions, you can mail me at :
    >
    > Thanks in advance
    > NGM
    >
    Marina, Jan 29, 2004
    #3
  4. No Sam.

    I never did that....Please try out the code...

    Thanks a lo

    ----- Sam Fields wrote: ----

    You didn't accidently remove the

    this.Load += new System.EventHandler(this.Page_Load)

    from the InitializeComponent() method in the web form designer generate
    code, did you

    Hope this helps
    Sa

    "NGM" <> wrote in messag
    news:..
    > Hello All
    >> From one week rather developing any code i have been discovering BUGS i

    asp.net
    > Please help me out on this
    >> I have class say 'Handler' which inherits System.Web.UI.Page

    > and i have put in a seperate DLL
    >> The code is show below
    >> using System

    > using System.Web
    > namespace FCTest
    >
    > public class Handler : System.Web.UI.Pag
    >
    > protected override void OnLoad(EventArgs args
    >
    >
    >
    >
    >> Now i inherit by wepage class from 'Handler' class instead o

    System.Web.UI.Page (it does not make a difference as Handler class inherit
    from System.Web.UI.Page
    >> Here is the simple code
    >> using System.Web.UI

    > using System.Web.UI.WebControls
    > using System.Web.UI.HtmlControls
    > using FCTest1
    >> namespace FCWebTest

    >
    > public class WebForm1 : FCTest1.Handle
    >
    > private void Page_Load(object sender, System.EventArgs e
    >
    > // Put user code to initialize the page her
    > int i = 1

    //<----- Control never reaches here!!! Help me out please
    > Response.Write("Hello")
    >
    >
    >
    >> Now the problem is the Page gets loaded and the Page_Load never get

    called!!!, the control simply does not reach there at all!!!
    >> Is this a BUG?? is there any workaround for this??
    >> Please help me out asap
    >> I really in need of solutions, you can mail me at :
    >> Thanks in advanc

    > NG
    >
    =?Utf-8?B?TkdN?=, Jan 29, 2004
    #4
  5. =?Utf-8?B?TkdN?=

    piinfosoft

    Joined:
    Jul 12, 2012
    Messages:
    1
    Check this value in Page top AutoEventWireup="true" if it is false page_load wil not call

    Sudipta Banerjee
    piinfosoft, Jul 12, 2012
    #5
    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. z. f.
    Replies:
    0
    Views:
    548
    z. f.
    Oct 19, 2004
  2. Replies:
    4
    Views:
    3,734
    VickZaro
    Apr 4, 2006
  3. rockdale
    Replies:
    1
    Views:
    647
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
  4. S_K
    Replies:
    6
    Views:
    1,159
    Robert Dunlop
    Nov 8, 2007
  5. Felix
    Replies:
    1
    Views:
    328
    Felix
    Sep 29, 2006
Loading...

Share This Page