473,802 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.P age,
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.P age
{
protected override void OnLoad(EventArg s args)
{
}
}
}

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

Here is the simple code:

using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using FCTest1;

namespace FCWebTest1
{
public class WebForm1 : FCTest1.Handler
{
private void Page_Load(objec t sender, System.EventArg s 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.c om

Thanks in advance
NGM

Nov 18 '05 #1
3 1267
You didn't accidently remove the:

this.Load += new System.EventHan dler(this.Page_ Load);

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

Hope this helps.
Sam

"NGM" <ng*****@yahoo. com> wrote in message
news:1F******** *************** ***********@mic rosoft.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.P age,
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.P age
{
protected override void OnLoad(EventArg s args)
{
}
}
}

Now i inherit by wepage class from 'Handler' class instead of System.Web.UI.P age (it does not make a difference as Handler class inherits
from System.Web.UI.P age)
Here is the simple code:

using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using FCTest1;

namespace FCWebTest1
{
public class WebForm1 : FCTest1.Handler
{
private void Page_Load(objec t sender, System.EventArg s 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.c om

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******** *************** ***********@mic rosoft.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.P age,
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.P age
{
protected override void OnLoad(EventArg s args)
{
}
}
}

Now i inherit by wepage class from 'Handler' class instead of System.Web.UI.P age (it does not make a difference as Handler class inherits
from System.Web.UI.P age)
Here is the simple code:

using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.H tmlControls;
using FCTest1;

namespace FCWebTest1
{
public class WebForm1 : FCTest1.Handler
{
private void Page_Load(objec t sender, System.EventArg s 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.c om

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.EventHan dler(this.Page_ Load)

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

Hope this helps
Sa

"NGM" <ng*****@yahoo. com> wrote in messag
news:1F******** *************** ***********@mic rosoft.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.P age 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.P ag

protected override void OnLoad(EventArg s args

Now i inherit by wepage class from 'Handler' class instead o

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

using System.Web.UI.W ebControls
using System.Web.UI.H tmlControls
using FCTest1
namespace FCWebTest


public class WebForm1 : FCTest1.Handle

private void Page_Load(objec t sender, System.EventArg s 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.c o
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
1778
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 selectcommand button), i assign some session variables and perform a rediect to a "more information" page. Neither page is using Output Caching. On the more information page, a button reads "new search". this clears the session variables i set in...
3
2431
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. First I tried adding the controls and the event handlers for my control in the Initialize Components method of my page in the hopes that it would fire the event before the
10
2858
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 have to add a datalist control. Using this datalist control I should be able to add edit, modify and cancel the items listed in this control. Here is how I designed. I used placeholder to add the controls dynamically to the page on the click...
9
2233
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) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
1
2747
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. So we have the Page_Load event of an ASPX page fire which in the snip you see calls "SomeMethod". Also you see in Page_Load two Catch statements. The first is "SpecialException". We created our own extended exception (inherits from...
5
3165
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 CommonPageBase - Contains myPage which inherits PageBase Each of these classes overrides OnInit and ties an event handler
4
1150
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 that page look cool). When I modify that page, somehow it is redirecting to default page. I have done my best to find any location that might be doing that and I can't find
0
5577
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
0
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10538
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10305
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9115
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7598
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.