Damian Mehers' Blog Evernote and Wearable devices. All opinions my own.

12Feb/073

Article: Cross-browser ASP.NET AJAX Control Extender support – trickier than I thought

I've just had an article on DotNetSlackers published on porting ASP.NET AJAX Control Extenders to multiple browsers.

Porting a control extender that I am working to contribute to the ASP.NET AJAX Control Toolkit turned out to far more involved than I initially thought it would be. If you are a hardcore JavaScript developer then a lot of this may be familiar. But if you are like me, and JavaScript is just one of many technologies you are using, read on to learn from my mistakes.

More at:

http://dotnetslackers.com/articles/ajax/CrossBrowserAjaxControlExtenderTips.aspx

Filed under: AJAX Leave a comment
Comments (3) Trackbacks (0)
  1. Dear Damian,
    considering i was trying to adapt the script to work for firefox without any success the cross browser article helped me with a thing or two. Thanks.

    By the way what did you use for debugging your code.
    trying to set breakpoints in ‘errorless’ javscript using firebug resulted in never hitting the breakpoint unless there is an error in the code. i.e break never occurs.
    and when it does hit a breakpoint. the onblur event resets the listsearch div.
    Sooo.. I Would be greatful if you could tell me What tools you use and how.(sorry for the lengthy comment)

  2. I’d be interested to hear why you had to use rawEvent to get to the key codes. Sys.UI.DomEvent should already do a cross-browser, consistent mapping of the codes that you should be able to directly compare with the key enumeration. Can you drop me mail so that we can discuss?

  3. Hello Bertrand,

    The issue is that what is passed in the charCode in the DomEvent is inconsistent across browsers for “special” keys such as the cursor keys for the KeyPress event (which IE doesn’t fire for these kinds of keys — the problem is in FireFox, Safari and Opera).

    The only way to determine whether the key that was pressed corresponds to a non-displayable key is to go under the hood.

    For example if you hit Ampersand (ascii code 38) you’ll get the same charCode as Sys.UI.Key.up in FireFox, in the KeyPress event.

    The relevant section the Ajax runtime is:
    if (e.type === ‘keypress’) {
    this.charCode = e.charCode || e.keyCode;
    }

    Damian (damian at atadore com)


Leave a comment

No trackbacks yet.