dotnetN00b dotnetN00b - 1 month ago 4x Question

Does C# have a Handles keyword?

Protected Sub Menu1_MenuItemClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MenuEventArgs) Handles Menu1.MenuItemClick

End Sub

In, we have the Handles keyword, I'm wondering if C# has anything comparable. Or do you have to manually wire all the methods to each control's event (in ASP.NET especially)?


Nope. You will have to wire up the event like this

Menu1.MenuItemClick += Menu1_MenuItemClick;