• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

Asp.net image button does not fire on fire on the first click

Experts I am using asp.net 1.1. I added a imagebutton control to my page, for some reason when I click the button the code does not fire, I have to click it a second time to execute the code within the image buttons click event.  The first click just reloads the page so what is going on?
0
tentavarious
Asked:
tentavarious
  • 2
  • 2
1 Solution
 
prairiedogCommented:
Can I take a look at your Page_Load event handler? Also your Button's Click event handler.
0
 
tentavariousAuthor Commented:
Here is the button event
 Private Sub ImageButton1_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles ImageButton1.Click
   'Code here
 End Sub

Here is page load
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  if not page.ispostback
   'some code here
 end if
 End Sub
0
 
vjc2003Commented:
Is ImageButton1 indeed the name of your image button? On debugging, is the page is posting back on first click on not entering the button click event handler?
0
 
prairiedogCommented:
1. Do you have an "onclick" event added to the ImageButton dynamically?
2. What do you do in the Page_Load event handler?
0
 
tentavariousAuthor Commented:
I did find the solution, but I am not sure why it worked.  There was a text changed event bound to one of my textfields, after I removed the event, my image button click event worked fine.  Any ideas why?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now