473,761 Members | 5,848 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Event handlers in Page class

Quick question,

I'm new to C# and ASP.NET.

Why do the OnInit, OnPreRender and other eventhandlers in the Page class
only have (Eventargs) as the only argument?

Isn't the signature of an event handler supposed to be (object, eventArgs)?

My only guess is that these aren't being assigned via a delegate, but
confirmation would be handy.

Cheers
Nov 16 '05 #1
1 1452
Hi,
There is difference between event handler and overridden method.

OnInit, OnPreRender, OnLoad and other methods with only one (EventArgs)
argument are overridden methods.

// overridden method, that overrides method OnLoad of base class (Page)
protected override void OnLoad(EventArg s e)
{
base.OnLoad(e);
}

// event handler
private void Page_Load(objec t sender,EventArg s e)
{
}

Tomas Petricek
Microsoft C# MVP

-----Original Message-----
From: Bingo [mailto:bi***@bi ngo.com]
Posted At: Monday, August 02, 2004 1:06 AM
Posted To: microsoft.publi c.dotnet.langua ges.csharp
Conversation: Event handlers in Page class
Subject: Event handlers in Page class

Quick question,

I'm new to C# and ASP.NET.

Why do the OnInit, OnPreRender and other eventhandlers in the Page class

only have (Eventargs) as the only argument?

Isn't the signature of an event handler supposed to be (object,
eventArgs)?

My only guess is that these aren't being assigned via a delegate, but
confirmation would be handy.

Cheers

Nov 16 '05 #2

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

Similar topics

10
3604
by: tony kulik | last post by:
This code works fine in ie and opera but not at all in Mozilla. Anybody got a clue as to how to get it right? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <script language="JavaScript" type="text/javascript"> function show(that) { if (box.style.visibility=='hidden') { that.style.visibility = 'visible'}; }
13
3518
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the following issues still exist. The article shows how to find methods on a receiver that match the pattern OnXXXX given the sender. It loops through the sender events and tries to get methods from the receiver that match the pattern. For each one...
7
1717
by: Michael D. Ober | last post by:
Is there anyway to raise an event from a class and require that any program using that class (not just inheritance) have an event handler for specific events in the class? In my case, some events don't need to be handled, but some must be handled by the program that uses the class. I'm looking for something along the lines of Class MyClass Event OptionalEvent(parms) Event RequiredEvent(parms)
9
14458
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it does not. The problem is that the webcontrols get created on the OnLoad event of the usercontrol and the event handlers are assigned at the same time. I have to click twice on the controls for the events to be raised, the first time nothing...
16
2516
by: Hamed | last post by:
Hello I am developing a utility to be reused in other programs. It I have an object of type Control (a TextBox, ComboBox, etc.) that other programmers use it in applications. they may set some of properties or assign event handlers. I need to be able to clone the manipulated control at runtime. I could use the Clone method of some objects (like Font, Style, String,
14
8638
by: Hamed | last post by:
Hello It seems that I should implement ICloneable to implement my own clone object. the critical point for me is to make a control object based on another control object that all of its event handlers are set like the old one. Is there a way to do this job? For example, is there a way to use EventInfo object to get all event handlers of the old control in runtime and set my new cloned control events to the event handlers of the old...
0
1014
by: droyad | last post by:
I have recently upgraded a web project from ASP.NET 1.1 to ASP.NET 2.0, and now the event handlers no longer work, due to the event handlers being defined in base classes. To start a bit of background, below is a simplified example, but the same design pattern is used for many other pages: In the ASPX file a button is defined: <asp:Button Runat="server" Text="Login" id="btnLogin"></asp:Button>
0
847
by: Hillbilly | last post by:
Right now I have a shitload of form data in an event handler I will need to reuse in other event handlers in the same page. Using firstName1 and firstName2 for strings can't possibly be the way I should be coding this type of task not to mention its tedious as all get out. What's a workable way to move the initialization out of the event handler and into the class or wherever so the data in the form can be used by different event handlers...
0
824
by: Hillbilly | last post by:
Right now I have a lot of form data in an event handler I will need to reuse in other event handlers in the same page. Using firstName1 and firstName2 for strings can't possibly be the way I should be coding this type of task not to mention its tedious as all get out. What's a workable way to move the initialization out of the event handler and into the class or wherever so the data in the form can be used by different event handlers in...
0
9522
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9336
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
10111
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
9948
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
9765
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8770
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...
0
5215
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3446
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2738
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.