Button Click event Firing Twice

When i was migrating code form C# to Vb.net

i face one problem that is when i perform action on button my Click event was Firing twice …

the solution for this was
first step is to make AUTOEVENTWIreup = false

next step is to remove OnClick=”BUtton1_Click” from aspx file


if it is like that

remove OnClick=”myButton_Click” from above code
every thing work fine

The reason the click was being handled twice was because the onclick handler was being specified twice

  1. once in the button tag as the OnClick attribute:
  2. 2)once in the code behind
    Protected Sub myButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles myButton.Click


About kakani santosh kumar

Working as Software Engineer in Prithvi Information Solutions having 3 years of Experience in Dotnet Framework ranging from 1.1 to 3.5
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s