Web form event handler not firing?

  • Thread starter Thread starter jeff29_b
  • Start date Start date
J

jeff29_b

I am having a strange problem on a web form. I have an image button
with an OnClick event handler. When I click the image the event isn't
being called in the code behind when browsing in firefox. I get the
postback but I never have the event called. It works fine in i.e.
 
Hi all,

Karl: thanks for the info on the bug, you were dead on. Interesting to note
that the posters on that site blame ASP.Net for this.
In your post you note that if the URL for the image is not good, the
arguments do not pass. Note that if you hide the button (style:display:none),
you also get the negative result in Mozilla/Firefox/Netscpape, even if the
image URL/Src is good.

I had a similar situation which I will post for the sake of others searching:

I had an Html Server Control <input type="image" runat="server" ... on which
I put an onclick event handler as well as the onserverlick. I had another
image button on my page as well. In Mozilla/Netscape the button without the
client onclick submitted fine and it's server-side code would run, but not
the button with the client-side event handler. Note: All worked fine in IE!

The client side code "swapped" them image to another one (hiding the image
using style=dispay:none on the button before form submittal to prevent
multiple form submissions/double clicks) hence the lack of arguments to the
server side event handler.

I ended up not hding the button but placing another over top to catch the
clicks...and so it worked fine after that in all browsers.
Well I had a problem there too in that the Divs I was using wouldn't change
thier z-index in IE 6, but worked fine in Mozilla/Firefox/Netscape (I had the
position set to relative!) Oh well, after more searching I got my solution to
that.

Thanks,
Stephen
 
its not a firefox bug, its an asp.net bug.

if there is no image and thus no image click (or return is used), it makes
no sense to send the x and y coordinates (as there aren't any). the image
value is posted. asp.net has a bug, where it only looks for the x and y
values, not the image value.

-- bruce (sqlwork.com)
 
Back
Top