Erik Porter's Blog

Life and Development at Microsoft and Other Technology Discussions

News

    ASP.NET AJAX BUG: $addHandler Can't Attach to Element Inside an IFrame in Internet Explorer

    I have an iframe on my page and an html page that's loaded in it (from the same domain) and an anchor tag is clicked in the iframe I want to execute some code on my page on the client.  In the Initialize method in my client object I call $addHandler and pass in the anchor tag from inside the iframe, 'click' (to attach to the onclick of the anchor tag) and my delegate.  I run the code in Firefox.  Everything works great.  I go to Internet Explorer and run it and when I click on the anchor tag inside of the iframe I get an error of "Sys.ArgumentNullException: Value cannot be null. Parameter name: eventObject".  A quick search turned up this gem of a workaround:

    Bug with $addHandler applied to element in an iFrame

    I hope the ASP.NET team fixes this in future versions of ASP.NET AJAX, but for now this will work.

    Comments

    Mike Swaim said:

    Have you reported this on connect? If it doesn't get reported (and voted on) in Connect, what makes you think that MS will fix it? (They don't fix bugs that they don't know about, or think is unimportant.)

    # January 17, 2008 8:51 AM

    HumanCompiler said:

    Mike,

    I work at Microsoft and already passed it along to the team.

    -Erik

    # January 17, 2008 1:30 PM