Find the right parameters for an event without using Design Mode in Visual Studio 2010

Posted by Jason on Stack Overflow See other posts from Stack Overflow or by Jason
Published on 2010-12-27T19:11:30Z Indexed on 2010/12/27 19:54 UTC
Read the original article Hit count: 244

Is there a way to know what parameters are needed by an event in Visual Studio 2010?

Let's say I have a DropDownList control and I want to bind a method to the "OnSelectedIndexChanged", I would do something like this

In the ASPX File:

<asp:DropDownList ID="lstMyList" runat="server" OnSelectedIndexChanged="lstMyList_SelectedIndexChanged"></asp:DropDownList>

In the codebehind:

protected void lstMyList_SelectedIndexChanged(object sender, EventArgs e) 
{
    ...
}

Is there a way to know what parameters the method needs? (In this case, an object for the sender and an EventArgs parameter for the event.)

I know you can easily create the method by double-clicking the right event in Design Mode, but it does a mess with your code so I prefer not to use it.

Thanks!

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET