views:

485

answers:

1

I have an oldish asp.net app. That is behaving differently in IE8 then IE7, even in IE7 compatiblity mode.

The app contains several User Controls that make use of the System.Web.UI.WebControls.Panel, it seems to me that IE8(inc 7 mode) render the panel as tables, but in IE7 they are rendered as divs.

Seems to me that ASP.Net is not identifying the browser properly, does anybody have any pointers on how to fix?

+1  A: 

Look at this

http://msdn.microsoft.com/en-us/library/x3k2ssx2(VS.80).aspx

Overriding Browser Type Detection

If you want to explicitly control how the page is rendered instead of relying on automatic browser detection, you can set the page's ClientTarget property. You can set the property declaratively as an attribute of the @ Page directive for that page, or you can set it programmatically.

The value of the ClientTarget property is an alias for the type of browser you want to render the page for. For example, to force the page to render for Microsoft Internet Explorer 6.0, you can use the alias uplevel. The alias must be defined in the clientTarget Element (ASP.NET Settings Schema) section of the configuration file. The predefined defaults are ie5, ie4, uplevel, and downlevel.

By specifying the alias downlevel, you can force the page to render HTML 3.2-compatible elements no matter what browser has requested the page. Similarly, by specifying uplevel, you can force the page to render CSS style attributes even for older browser versions.

You can create additional aliases by defining them in the Machine.config or Web.config file, which enables you to create custom browser definitions. For more information, see ASP.NET Configuration Settings.

Lou Franco
I've set ClientTarget="uplevel" for now - seems the Live server is ignoring the browserCaps section in the web.config. My dev/tests can id the browser but the live server fails with IE8. Need to have words with the admin and i've asked a further question here: http://stackoverflow.com/questions/1037708
Adrian