473,396 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

NGM
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 : ng*****@yahoo.com

Thanks in advance
NGM

Nov 18 '05 #1
3 1252
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" <ng*****@yahoo.com> wrote in message
news:1F**********************************@microsof t.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 : ng*****@yahoo.com

Thanks in advance
NGM

Nov 18 '05 #2
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" <ng*****@yahoo.com> wrote in message
news:1F**********************************@microsof t.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 : ng*****@yahoo.com

Thanks in advance
NGM

Nov 18 '05 #3
NGM
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" <ng*****@yahoo.com> wrote in messag
news:1F**********************************@microsof t.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 : ng*****@yahoo.co
Thanks in advanc

NG

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Elliot M. Rodriguez | last post by:
I am having a heckuva time debugging this, or determining why my page is behaving this way. I have a search form, that when completed, returns a datagrid. When the user selects a row (normal...
3
by: Kenton Smeltzer | last post by:
Hello All, I am having a problem with events and the addition of controls on a page I am developing. First let me tell you what I have tried and then maybe someone can see something I missed. ...
10
by: Bharat | last post by:
Hi Folks, Suppose I have two link button on a page (say lnkBtn1 and lnkBtn2). On the click event of the lnkbtn1 I have to add a dynamically created control. And On the click event of the lnkBtn2 I...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
1
by: MikeM | last post by:
We are getting a behavior on a Response.Redirect("SomeUrl", True) that I'm hoping someone can explain. This all refers to the code snip at the end. By the way, this is all VB ASP.NET v1.0 code. ...
5
by: Andy | last post by:
Hi all, I have a site with the following architecture: Common.Web.dll - Contains a CommonPageBase class which inherits System.Web.UI.Page myadd.dll - Contains PageBase which inherits...
4
by: JohnAD | last post by:
Hello NG, Maybe it is a wrong NG but posting here because I have got some great replies from here. I have inherited these web pages. One of the page has lots of stuff (mostly calls to make...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.