johnglad:
Nice, thanks for the suggestion. The following worked. I haven't tested it extensively yet, but it seems promising.
public class BasePage : System.Web.UI.Page
{
protected override void OnLoad(EventArgs e)
{
//add ie6 and ie7 only stylesheets
string path = Request.ApplicationPath + "/assets/";
this.Header.Controls.Add(new LiteralControl("<!--[if IE 6]><link rel=\"stylesheet\" type=\"text/css\" href=\""+path+"ie6.css\" media=\"screen\"/><![endif]-->"));
this.Header.Controls.Add(new LiteralControl("<!--[if IE 7]><link rel=\"stylesheet\" type=\"text/css\" href=\""+path+"ie7.css\" media=\"screen\"/><![endif]-->"));
}
}
Your proposed solution will work, but it really makes things more complex then they have to be.
Furthermore; Web Designers or CSS experts don't generally know C#, so this solution has the potential to limit future maintenance. As a rule of thumb it's good to keep things simple; implementing work arounds for the way Themes treat CSS files (disregarding media types, disregarding load order preference, disregarding conditional comments, and so on) really makes things more complex then they actually are - It turns into a case of not seeing the forest from the trees.
Themes can work for you, and default skins are nice for specifying the CssClass, but giving complete CSS control to Themes introduces problems.
Anyhow; glad you found the articles useful, I'd be interested in any alternative work arounds or suggestions you have.
-Adam Kahtava [
http://adam.kahtava.com]