<p>I'm working on a website that will switch to a new style on a set date. The site's built-in semantic HTML and CSS, so the change should just require a CSS reference change. I'm working with a designer who will need to be able to see how it's looking, as well as a client who will need to be able to review content updates in the current look as well as design progress on the new look.</p>
<p>I'm planning to use a magic querystring value and/or a javascript link in the footer which writes out a cookie to select the new CSS page. We're working in ASP.NET 3.5. Any recommendations?</p>
<p>I should mention that we're using IE Conditional Comments for IE8, 7, and 6 support. I may create a function that does a replacement:</p>
<pre><code>&lt;link href=&quot;Style/&lt;% GetCssRoot() %&gt;.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;!--[if lte IE 8]&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;Style/&lt;% GetCssRoot() %&gt;-ie8.css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;![endif]--&gt;
&lt;!--[if lte IE 7]&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;Style/&lt;% GetCssRoot() %&gt;-ie7.css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;![endif]--&gt;
&lt;!--[if lte IE 6]&gt;
    &lt;link type=&quot;text/css&quot; href=&quot;Style/&lt;% GetCssRoot() %&gt;-ie6.css&quot; rel=&quot;stylesheet&quot; /&gt;
&lt;![endif]--&gt;
</code></pre>

[{'answer_id': 5151, 'author': 'palmsey', 'author_id': 521, 'author_profile': 'https://Stackoverflow.com/users/521', 'pm_score': 2, 'selected': False, 'text': '<p>I would suggest storing the stylesheet selection in the session so you don\'t have to rely on the querystring key being present all the time. You can check the session in Page_Load and add the appropriate stylesheet reference. It sounds like this is a temporary/development situation, so go with whatever is easy and works.</p>\n\n<pre><code>if (!String.IsNullOrEmpty(Request.QueryString["css"]))\n  Session.Add("CSS",Request.QueryString["css"]);\n</code></pre>\n'}, {'answer_id': 5160, 'author': 'Yaakov Ellis', 'author_id': 51, 'author_profile': 'https://Stackoverflow.com/users/51', 'pm_score': 6, 'selected': True, 'text': '<p>In Asp.net 3.5, you should be able to set up the Link tag in the header as a server tag. Then in the codebehind you can set the href property for the link element, based on a cookie value, querystring, date, etc.</p>\n\n<p>In your aspx file:</p>\n\n<pre><code>&lt;head&gt;\n  &lt;link id="linkStyles" rel="stylesheet" type="text/css" runat="server" /&gt;\n&lt;/head&gt;\n</code></pre>\n\n<p>And in the Code behind:</p>\n\n<pre><code>protected void Page_Load(object sender, EventArgs e) {\n  string stylesheetAddress = // logic to determine stylesheet\n  linkStyles.Href = stylesheetAddress;\n}\n</code></pre>\n'}, {'answer_id': 5161, 'author': 'Shawn', 'author_id': 26, 'author_profile': 'https://Stackoverflow.com/users/26', 'pm_score': 3, 'selected': False, 'text': "<p>You should look into <code>ASP.NET</code> themes, that's exactly what they're used for. They also allow you to skin controls, which means give them a set of default attributes.</p>\n"}, {'answer_id': 5162, 'author': 'GateKiller', 'author_id': 383, 'author_profile': 'https://Stackoverflow.com/users/383', 'pm_score': -1, 'selected': False, 'text': '<p>I would do the following:</p>\n\n<p><a href="http://www.website.com/?stylesheet=new.css" rel="nofollow noreferrer">www.website.com/?stylesheet=new.css</a></p>\n\n<p>Then in your ASP.NET code:</p>\n\n<pre><code>if (Request.Querystring["stylesheet"] != null) {\n    Response.Cookies["stylesheet"].Value = Request.QueryString["stylesheet"];\n    Response.Redirect(&lt;Current Page&gt;);\n}\n</code></pre>\n\n<p>Then where you define your stylesheets:</p>\n\n<pre><code>if (Request.Cookies["stylesheet"] != null) {\n    // New Stylesheet\n} else {\n    // Default\n}\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/5118', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5/']