Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8335123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:34:14+00:00 2026-06-09T03:34:14+00:00

When I double click on a button (myButton) in Design view of a .aspx

  • 0

When I double click on a button (myButton) in Design view of a .aspx web form, an event handler is automatically generated in the code behind: protected void myButton_Click(object sender, EventArgs e)

Now if I understand correctly, in order to associate that method with the Button.Click event, somewhere there has to be something like: myButton.Click += new EventHandler(this.myButton_Click);

However, I can’t seem to find that anywhere. I’ve used Ctrl+F for the entire solution and I’ve checked the mywebform.aspx.designer.cs.

At first I thought it was because the .aspx page’s AutoEventWireup was set to true. However, even after making AutoEventWireup false, the button still responds to being clicked by running the code in protected void myButton_Click(object sender, EventArgs e)

I understand that you shouldn’t mess with generated code, and I don’t intend to, I just want to know more about how this is working under the hood.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:34:16+00:00Added an answer on June 9, 2026 at 3:34 am

    The assignment of the event handler is actually done in the asp markup. Here’s a link to a bunch of different properties that can be declaratively assigned to your button.

    Here’s another MSDN link about using the OnClick attribute.

    I’m guessing that your ASP markup for the button has the following property assigned:

    OnClick="myButton_Click"

    As for how it gets translated into an assignment, the page gets compiled at runtime upon the first time it is requested (ASP.NET Compilation Overview).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unable to create Event Handler when i double click on button or
How I can handle the Mouse Right Button Double Click event for a Shape
I'm using vc2008, writing some MFC code, I add a button, double click it,
Let's say you want to auto generate an event handler for a button click
I don't want to allow user to double click on my button. On the
If I accidentally double-click a button on a Winform in the visual studio designer
From the Designer in VS let's say you double click on a button and
Possible Duplicate: Need to cancel click/mouseup events when double-click event detected Preventing double-click of
I'm trying to catch a double-click event in a TreeView's empty area to create
I have a form with a text area. Some people double-click on the submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.