Step: 2 Code
Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
public delegate void Del(string message);
protected void Page_Load(object sender, EventArgs e)
{
// Instantiate the delegate.
Del handler = DelegateMethod;
L1.Text+="<br/> Page_Laod() started";
String str = " <br/> string used : <font color='red'>public delegate
void Del(string message)</font>";
// Call the delegate.
handler(str);
}
// Create a method for a delegate.
public void DelegateMethod(string message)
{
L1.Text += "<br/>DelegateMethod(string message) started ";
L1.Text += message;
}
}