Tuesday, September 25, 2007

Multicast Delegate

Multicast Delegate:

delegate void getvalue();

public partial class Global : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
getvalue test=new getvalue(testbala);
//Note:Single instance we have to call two method that is called multicast delegate
test += new getvalue(testbala1);
test();
}

protected void testbala()
{
Response.Write("Bala");
}
protected void testbala1()
{
Response.Write("Bala1");
}

Output:

Bala
Bala1