Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 18th, 2006, 10:42 AM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 550
Thanks: 0
Thanked 1 Time in 1 Post
Default Help with events & delegates

Hi

I have worked on both eventhandlers and delegates at a basic level, what I felt that what I can do with delegates, can be done with eventhandler. So what is the difference between the two, plz can someone explain, plz do not give any links to study.

Regards
Mike

Fortune favours the brave, so don't regret on missed oppurtunities.
__________________
Regards
Mike
 
Old December 18th, 2006, 10:54 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Essentially, Events and Delegates behave the same way. (Compile a program and look at the IL you will notice they behave identical)

If you check out the MSDN C# Keyword list you can see that event is a modifier and can be included in a Interface where as a delegate can not. In a nutshell:

The event keyword is a modifier for a delegate declaration that allows it to be included in an interface, constraints it invocation from within the class that declares it, provides it with a pair of customizable accessors (add and remove) and forces the signature of the delegate (when used within the .NET framework).

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
Runtime controls & Javascript events ITGeek ASP.NET 1.0 and 1.1 Professional 4 July 2nd, 2007 03:45 PM
DataGrid's Events & Browsers Back Button Mr.PankajKhare General .NET 0 March 16th, 2007 04:09 AM
Calculations & Events on Array tobriain C# 0 February 21st, 2007 05:03 AM
Events with VBA & MS Access hoen VB How-To 0 January 19th, 2006 10:18 PM
Linux & KDE & C++ & QT & MYSQL & Kdevelop Munnnki Linux 0 January 2nd, 2005 05:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.