IE 8’s frameBorder Error in ASP.NET AJAX Extensions

This issue crops up when I happen to use the application that’s using ASP.NET Ajax Extensions components. In my case, the error is occured inside the asp:updatepanel component.

Here is the symptom when I try to click inside the generated panel in IE version 8, with debugging option enabled :

As you can see from the above error message, when I click the panel, the AJAX client side component triggers the Sys.ArgumentOutOfRangeException.

By viewing the callstack of the Development Tools provided by IE 8, you can see that this error generated at function Sys$UI$Point(x, y) in the AJAX framework client script.

Closer examination reveals the function is not the cause of the error, but rather from the computation of the coordinate location :

offsetL += (f.frameBorder || 1) * 2 + (parseInt(fstyle.paddingLeft) || 0) + (parseInt(fstyle.borderLeftWidth) || 0) – element.ownerDocument.documentElement.scrollLeft;

Which is inside the Sys$UI$DomElement$getLocation(element) function.

Here’s how the frameBorder become issue in the IE 8, because this property evaluates to “no” and all of the subsequent calculation will returns a NaN as offsetL value. And this, in turn triggers the ArgumentOutOfRangeException error.

In MSDN documentation, possible value for frameBorder is defined as string value and can have these possibilities of value :

1 Default. Inset border is drawn.
0 No border is drawn.
no No border is drawn.
yes Inset border is drawn.

The default value, when not specified is 1, which causes the browser draws an inset border. And there are 2 posibilities to make frame borderless, i.e. the “no” string or “0” (literal zero) string.

So, if you happen to use IE 8 that happens to use FRAME element and ASP.NET AJAX Extensions, be sure to change the “no” values in frameBorder to “0” in all of your affected pages. Happy replacing 🙂


Leave a Reply

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

You are commenting using your 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

%d bloggers like this: