Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Forum
September 21, 2008
Delegate is completely going over my HEAD....
pls anyone can make me understand this theory by any other way and pls it will be more better for me if u could give any programe example:
A delegate is a simple class that is used to point to methods with a specific signature, becoming essentially a type-safe function pointer. A delegate's purpose is to facilitate a call back to another method (or methods), after one has been completed, in a structured way.
Pretend you have Class A that performs a process when its method DoTask is called. Your ASPX page creates an instance of that class and calls DoTask. When the task is completed, you want your ASPX page to call another method from another class. At the same time you also want to make sure that any class's method (an instance or a static method) can be run after DoTask, without having DoTask know anything about the class or its method. As long as the method conforms to a specific signature, it should be run.
Posted Date: September 21, 2008 Points: 5
See this example will help you to understand the Delegate..
Mark As Answer
" if this post help you.
Posted Date: September 24, 2008 Points: 5
Thanks Amit to reply but I know that how to use Delegate and all its flow, my confusion is what to take that why to use delegate...what is that I cant do without Delegate? what is requirement to use Delegate...
Hope you got what i wanted to ask now..
Posted Date: August 16, 2010 Points: 5
A delegate is like a reference to a method. Once a delegate object, encapsulate a reference to a method inside it, the delegate can be called like the method, with same parameters and return-Type. Similar to function pointer in C or C++, A delegate in C# is used as reference to a method.
The delegates are used where we just know the signature of method, The name of the method remain unknown and needs to be invoked at runtime. Hence the method, is passed as a parameter to a delegate, The delegate can be called like the normal method. The features of delegates are as follows:
* Delegates are type safe, unlike pointer in c or c++.
* Delegates allow methods to be passed as parameters.
* Multiple methods can be called on a single event, By chainning the Delegates together.
for more info
To post reply
Related Questions Related Questions
What is the use of delegate in .NET Framework?
Delegate in ASP.Net
What is the difference between Delegate and delegate?
What is difference between Delegate and delegate in c#?
what is the DIFFERENT between DECLARE A DELEGATE and DECLARE A EVENT BASED DELEGATE?
Asynchronous event using delegate
Latest Forum Questions From The Same Category
Slash(/) in Combobox
attaching the report in the web page
How do i get payment status in redirect page using bitpay?
Login with Facebook and Save details in database
Login with facebook account in my website
How to make a nested datalist control?
What class does Icon derive from?
What are the validation controls?
What''s the difference between an interface and abstract class?
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more
Quick Links For Forum Categories:
Hall of Fame
Terms of Service
Tell A Friend