Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Help me out: ASP.Net BUG: Page_Load event not called! (http://www.velocityreviews.com/forums/t71821-help-me-out-asp-net-bug-page_load-event-not-called.html)

=?Utf-8?B?TkdN?= 01-29-2004 02:36 PM

Help me out: ASP.Net BUG: Page_Load event not called!
 
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 : ngm_bec@yahoo.com

Thanks in advance
NGM


Sam Fields 01-29-2004 02:43 PM

Re: Help me out: ASP.Net BUG: Page_Load event not called!
 
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" <ngm_bec@yahoo.com> wrote in message
news:1F59FCB7-B506-49B8-B5A7-0DA132BBF14F@microsoft.com...
> 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 : ngm_bec@yahoo.com
>
> Thanks in advance
> NGM
>




Marina 01-29-2004 02:48 PM

Re: Help me out: ASP.Net BUG: Page_Load event not called!
 
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" <ngm_bec@yahoo.com> wrote in message
news:1F59FCB7-B506-49B8-B5A7-0DA132BBF14F@microsoft.com...
> 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 : ngm_bec@yahoo.com
>
> Thanks in advance
> NGM
>




=?Utf-8?B?TkdN?= 01-29-2004 02:56 PM

Re: Help me out: ASP.Net BUG: Page_Load event not called!
 
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" <ngm_bec@yahoo.com> wrote in messag
news:1F59FCB7-B506-49B8-B5A7-0DA132BBF14F@microsoft.com..
> 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 : ngm_bec@yahoo.co
>> Thanks in advanc

> NG
>


piinfosoft 07-12-2012 12:48 PM

Check this value in Page top AutoEventWireup="true" if it is false page_load wil not call

Sudipta Banerjee


All times are GMT. The time now is 04:44 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.