Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 May 23rd, 2010, 01:22 AM
Friend of Wrox
 
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Smile Elaboration for delegate

Hi Imar
I really have problem by Delegate(in C#) and event handler and their arguments.can you elaborate this?
 
Old May 23rd, 2010, 05:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Can you post questions not directly related to the book in a general ASP.NET category here: http://p2p.wrox.com/asp-net-4-539/ ? If it is book related, please post a chapter or page number.

If you do repost there, be sure to be more explicit with what you ask as your current question is pretty vague.

In the mean-time, maybe this helps: http://www.google.com/#hl=en&source=...7ecd1ca1f09b98

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
morteza (May 23rd, 2010)
 
Old May 23rd, 2010, 05:22 AM
Friend of Wrox
 
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Default

Yes its page 188 (Events)
I now Event what to do but I don't now whats different bitween function and Event handler
Other Problem is that i do not now its(Event Handler) parameter use can you describe it details .
thanks
 
Old May 23rd, 2010, 05:25 AM
Friend of Wrox
 
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Default

Oh OK i do your says for later
I am sorry.
 
Old May 23rd, 2010, 09:30 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I am sorry.
No problem at all. Things just get easier for everyone if you post in the right category and ask detailed questions.

An event handler is a method designed to handle an event. By itself it's nothing special as it's a normal method with two parameters. However, whenthey are hooked up / linked to an event, they are called automatically when that event occurs.

A typical event handler accepts two parameters: sender which is often the object that caused the event to fire and e (which often is, or inherits from System.EventArgs) to provide extra data for the event.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
morteza (May 24th, 2010)
 
Old May 24th, 2010, 11:31 PM
Friend of Wrox
 
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Default

Thank's I understood it.
 
Old June 6th, 2010, 12:16 AM
Friend of Wrox
 
Join Date: Apr 2010
Posts: 125
Thanks: 20
Thanked 3 Times in 3 Posts
Default

Hi imar,
In event handler such as page_load , it have two arguments:
1- sender (object)
2- e(EventArgs)
I know sender here is the form, but i don't know What is the e .
Thanks
 
Old June 6th, 2010, 06:30 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
and e (which often is, or inherits from System.EventArgs) to provide extra data for the event.
In the case of Page_Load, e is just an empty handler of type System.EventArgs that adds no value, other than to stick to the standard rules of a sender and an e argument for event handlers.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Differences between Delegate AND Strategy Pattern Luka77 BOOK: Professional PHP Design Patterns 2 April 28th, 2010 05:40 PM
custom delegate for ToolStripMenuItem maricar C# 4 September 4th, 2008 03:07 AM
Delegate query elwappo General .NET 6 June 5th, 2008 03:07 AM
What Is Delegate jayakumar.cj ASP.NET 1.0 and 1.1 Basics 1 July 15th, 2006 06:09 AM





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