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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s