Double-click the control is easiest way in Design view to create an event handler - ASP.NET

Q.  What is the easiest way in Design view to create an event handler for the default event of a server control?

- Published on 28 Jul 15

a. Open the code-behind page and write the code.
b. Right-click the control and select Create Handler.
c. Drag an event handler from the Toolbox to the desired control.
d. Double-click the control.

ANSWER: Double-click the control.
 

    Discussion

  • Brijesh   -Posted on 19 Oct 15
    . When you Double-click the server control an event handler is created in code behind file. As an example when you double click on button control the following event handler will be created.
    protected void Button1_Click(object sender, EventArgs e)
    {
    }

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)