When My ASP.NET page does a postback in IE7, all the CSS is lost. I am not using Themes and are including the CSS from the Masterpage in code behind.
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
AddStylesheetInclude("/static/css/global.css");
AddStylesheetInclude("/static/css/sifr.css");
}
And my code to actually do the adding:
public virtual void AddStylesheetInclude(String url)
{
HtmlLink link = new HtmlLink();
link.Attributes["type"] = "text/css";
link.Attributes["href"] = url;
link.Attributes["rel"] = "stylesheet";
Page.Header.Controls.Add(link);
}
It works perfectly fine in Firefox, just IE. To add more context, in the CSS file included, it uses @import to include the rest.
[Edit] It works if I take all the @import rules and have it included in the actual HTML.