The "-" operator can be used to remove a component delegate from a multicast delegate.
1. Open Visual Studio go to>>File>>New>>Website>>Asp.net Empty Website and name anything but named DelegatesExplained:

2. Add New WebForm to your Project and Name DelegateExplained.aspx,you can name anything:

3. Add the following under the body tag of Desing page of DelegatesExplained.aspx:

3. Add the following under the body tag of Desing page of DelegatesExplained.aspx:
- <form id="form1" runat="server">
- <div>
- <asp:Label ID="Label1" runat="server"></asp:Label>
- <asp:Label ID="Label2" runat="server"></asp:Label>
- <asp:Label ID="Label3" runat="server"></asp:Label>
- </div>
- </form>
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- public delegate void Delegates();
- protected void Page_Load(object sender, EventArgs e)
- {
- }
- public void First()
- {
- Label1.Text = "First";
- }
- public void Second()
- {
- Label2.Text = "Second";
- }
- public void Third()
- {
- Label3.Text = "Third";
- }
6. Create Objects Of Delegate under pageload() method:
- protected void Page_Load(object sender, EventArgs e)
- {
- MultipleDelegate m1,m2,m3;
- }
- public void First()
- {
- Label1.Text = "First";
- }
- public void Second()
- {
- Label2.Text = "Second";
- }
- public void Third()
- {
- Label3.Text = "Third";
- }

Join the conversation! Your thoughts help the community grow.