?
Solved

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

Posted on 2008-06-12
5
Medium Priority
?
782 Views
Last Modified: 2013-11-26
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
Comment
Question by:tentavarious
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:prairiedog
ID: 21772846
Can I take a look at your Page_Load event handler? Also your Button's Click event handler.
0
 

Author Comment

by:tentavarious
ID: 21778064
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
 
LVL 2

Expert Comment

by:vjc2003
ID: 21819962
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
 
LVL 22

Accepted Solution

by:
prairiedog earned 375 total points
ID: 21822236
1. Do you have an "onclick" event added to the ImageButton dynamically?
2. What do you do in the Page_Load event handler?
0
 

Author Comment

by:tentavarious
ID: 21824713
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

Featured Post

Quick Start: DOCKER

Sometimes you just need a Quick Start on a topic in order to begin using it.. this is just what you need to know to get up and running with Docker!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question