Problem with firefox

J

jeff29_b

I tried to post this message before but didn't see it. In firefox, an
OnClick event handler for the codebehind class is not being call on an
asp:ImageButton. It works fine in i.e.? Any ideas?
 
K

Kevin Spencer

Is JavaScript turned on?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
J

jeff29_b

Yes, and it it seems to work on some pages, but something about this
form causes it to choke in firefox.
 
B

bruce barker

its an asp.net bug

first the imagebutton does not use javascript. but asp.net does have a bug
in handling the postback of an image button when the enter key is pressed
instead of being clicked on.

the w3c spec says when an image button is clicked, in addtion to the value
being submitted, the x and y coordinates inside the image are passed (so the
button can be used as an imagemap).

take the following html

<input type=image src=myimg.gif value=1 name=mysubmit>

if you clicked on the upper right corner, then the browser sends:

mysubmit=1&mysubmit_x=1&mysubmit_y=1

now if you hit enter most browsers (but not IE) send

mysubmit=1

so if you are concerned where the user clicked, you know they didn't, but IE
sends

mysubmit=1&mysubmit_x=0&mysubmit_y=0

asp.net has a bug where it renders the image button as:

<input type=image src=myimg.gif name=mysubmit>

(no value attribute is rendered) so the click from above sends

mysubmit_x=1&mysubmit_y=1

and an enter press sends:

mysubmit_x=0&mysubmit_y=0 in IE

while in other browsers, no values for the image are posted at all.

asp.net is looking for the x or y value, doesn't see it and therefore can
not do the onclick dispatch. as an aside, the same behavior occurs if images
are not rendered (turned off by the user).

-- bruce (sqlwork.com)


| I tried to post this message before but didn't see it. In firefox, an
| OnClick event handler for the codebehind class is not being call on an
| asp:ImageButton. It works fine in i.e.? Any ideas?
|
 
J

jeff29_b

Karl, I can't find the other thread, it seems to have disappeared. One
additional note is that the pages seem to work fine if I have the
appropriate image for the imagebutton, if not it chokes when you click
on the alternate text. I imagine I am clicking outside of the control
region so it breaks the internal event wiring code in asp.net?

Is this a none issue with firefox and does anyone know the internals on
how asp.net maps an input click to an eventhandler. Is it from the
form parameter x and y coordinates because there are no eventarg params
for an onclick event for a form.
 
K

Karl Seguin

Jeff, I realize your answer has now been answered in this thread, but here's
my original reply:

-->
You didn't provide us with much detail (like sample code), but there is a
known bug in FireFox 1.0/ASP.Net where, if you leave the ImageUrl blank,
postback
won't fire.
https://bugzilla.mozilla.org/show_bug.cgi?id=258621

So this is assuming you aren't specifying an image...
<--

Karl
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top