Click here to Skip to main content
16,021,288 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Why we use delegates and what is the major role? I have taken 2 web forms and in each form I have taken one textbox. By using delegates if I write any thing in one text box it will reflect on other textbox in another form - is it possible?

Thanks!
Posted
Updated 26-Apr-11 19:46pm
v2

You should search Google/Bing before you ask such question. There is a comprehensive documentation in MSDN, plus there are so many other articles/tutorials with examples.
Start here[^]!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Apr-11 2:07am    
There is no other way. A 5. OP should not waste time on Question before getting this background.
--SA
Ankur\m/ 27-Apr-11 2:09am    
Absolutely!

And thanks again!
Sergey Alexandrovich Kryukov 27-Apr-11 2:12am    
...However, I could not stop referencing to some part of my "answer portfolio".
Please see my answer.
--SA
To understand delegates, you should first try and go through some books that explain the concept to you.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 27-Apr-11 2:08am    
Agree, my 5. There is no other way.
--SA
Abhinav S 27-Apr-11 2:08am    
Absolutely no other way.
Thanks for the 5.
Sergey Alexandrovich Kryukov 27-Apr-11 2:12am    
...However, I could not stop referencing to some part of my "answer portfolio".
Please see my answer.
--SA
Please see this discussion, just for a general view on what's involved:
What are the advantages of delegates in C#.NET?[^].

See also:
Pass a method with N params as parameter in C#[^].

Using in connection with events:
how to call keydown event on particular button click[^],
[Solved] How to add Event for C# Control[^].

—SA
 
Share this answer
 
Comments
Ankur\m/ 27-Apr-11 2:16am    
I will read all of them out. Meanwhile take a 5! :)
Sergey Alexandrovich Kryukov 27-Apr-11 2:18am    
Thank you, Ankur.
--SA
RaviRanjanKr 27-Apr-11 2:17am    
Nice! My 5 SA :)
Sergey Alexandrovich Kryukov 27-Apr-11 2:18am    
Thank you, Ravi.
--SA
After some experts advice I am suggesting you should go there[^] to read when and why you use delegate.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900