ASP.NET & AlternatingRowStyle & IE8

If you’re a ASP.NET developer like myself, you may or may not have noticed a few changes to your sites when viewed in Internet Explorer 8.

As an example I had a gridview which had a different background for alternating rows.

<AlternatingRowStyle CssClass="odd" /></code>

And my CSS was something like

.odd { background-image: url(../graphics/tealbg.gif); }

The Solution

The easy (and maybe a little messy) way to solve this is to force the page to use IE7 compatibility. You can do this by adding the following to your tag.

<meta http-equiv="X-UA-Compatible" content="IE=7" />

Note: The above meta tag MUST appear before any link tags (stylesheet includes for example)

No related posts.



One Response to “ASP.NET & AlternatingRowStyle & IE8”

Leave a Reply