Hi Walter,
I made some progress on this issue. I finally found a workaround.
Please find below my comments.
[quoted text, click to view] > I can now see the issue you mentioned clearly. However, I don't think this
> issue is related to asp.net at all: consider following simple html page:
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="
http://www.w3.org/1999/xhtml" >
> <head>
> <title>Untitled Page</title>
> </head>
> <body>
> <div id="mydiv" style="width:100px;height:100px;background-color:blue"
> onkeydown="javascript:alert('onkeydown')"></div>
> <input type="text" id="mytxt" onkeydown="javascript:alert('mytxt')" />
> </body>
> </html>
>
> Try this html page in IE and FireFox, you will see when you click on the
> div and press any key, FireFox will not show a messagebox.
Indeed, but here you use the 'onkeydown' html element attribute.
You will find below the code of an html page that basically does what
the MS Ajax library is doing at init time using the DOM API.
As it is, it reproduces the behavior I have with MS js lib.
That is, the keydown event handler is not called.
Doing more tests, I found that in order to the key event handler is
called under Firefox, the div elt must have its 'tabIndex' property set
to -1.
In this case, the keyboard event handlers are called as expected, as under
IE.
(To see the fixed behavior in the sample below, uncomment the line
"elt.tabIndex = -1;").
I don't know whether such a workaround could be integrated into the MS ajax
js
library, as it might be too intrusive, and whether it is a bug or not.
I really don't know so I let you decide what to do with that. On my side,
the fix is easy and the issue is fixed.
[quoted text, click to view] > By the way, you should always use ClientID when generating client-side
> content, which means you need to change the code in your OnRenderControl
> to:
>
> writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID);
Yes, thanks. It seems I wrote my sample too fast :-)
Thanks for your help,
Patrick