Use Delegates in Csharp

Delegates :

if you want to use delegates without parameter or  with parameter. but if you follow same syntax like to used in method

First of all how to create delegates see in below image

delegates.bmp

Here I have used a small program which demonstrates the use of delegate.

The delegate "Sum_Delegate" is declared with int return type and accepts only two integer parameters.

and how to call this delegates into page_load see this below image

2.bmp


This is Simple Delegates use  in call same parameter method and  output of this delegates is

untitled.bmp


Ebook Download
View all
Learn
View all