473,386 Members | 1,706 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,386 software developers and data experts.

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 1438
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(EventArgs e)
{
base.OnLoad(e);
}

// event handler
private void Page_Load(object sender,EventArgs e)
{
}

Tomas Petricek
Microsoft C# MVP

-----Original Message-----
From: Bingo [mailto:bi***@bingo.com]
Posted At: Monday, August 02, 2004 1:06 AM
Posted To: microsoft.public.dotnet.languages.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
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...
13
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...
7
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...
9
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...
16
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...
14
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...
0
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...
0
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.