@mouse_8b:
Thank you for offering up your suggestion for conditional stylesheets. I tried it, but there were some things that didn't work well for me. First, the path isn't relative, so in order for this to work properly in my dev and production environments (my dev site doesn't sit on the root of my dev domain), I would have had to change the paths accordingly. Not that big of a deal, but I don't like to have loose ends like that.
So in my attempt to generate relative urls for this method, I created a custom control to be called in the 'HeaderData' section via the '[[ConLib...]]' method, and in doing so, I couldn't get the 'HeaderData' section to properly inject my new lines into the <head> of my document. If I used multiple, broken-apart commented sections (like in your example above), it wanted to place my new lines - and the closing '</HeaderData>' tag into the body of my document. If I didn't use multiple commented sections, and instead placed the '[[ConLib..]]' call directly between the opening and closing 'HeaderData' tags, it simply printed my custom control call directly on the page in plain text. So it's apparent that this header field simply wasn't designed to look for custom controls like the the content field does.
I went a different way, and it appears to be working.
Maybe some of you seasoned .Net developers can tell me if there is any reason why this is a bad idea. Based on the reasoning I found here:
http://www.selarom.net/blog/2011/04/05/ ... ments.aspx, I added the following to the 'Scriptlet.master':
Code: Select all
<script runat="server">
protected override void Render(HtmlTextWriter writer)
{
//less than IE9
string style = "<!--[if lt IE 9]>";
style += "<link rel=\"stylesheet\" href=\"" + this.ResolveUrl("~/IEStyles/ltie9style.css") + "\" type=\"text/css\" media=\"screen\" />";
style += "<![endif]-->";
Literal styleCtrl = new Literal();
styleCtrl.Text = style;
head1.Controls.Add(styleCtrl);
base.Render(writer);
}
</script>