title: Dynamic CSS page using Classic ASP
body: <p>I've been trying to figure out how to pull in a dynamic CSS stylesheet using classic asp. I've read quite a few tutorials on the subject and I can't seem to get it to pull in properly. Many of them seem to imply that just changing to styles.asp or .aspx and referencing it using the standard stylesheet link will work, but I'm not getting that result.</p>
  
  <p><a href="https://web.archive.org/web/20211020131223/https://www.4guysfromrolla.com/webtech/tips/t071201-1.shtml" rel="nofollow">https://web.archive.org/web/20211020131223/https://www.4guysfromrolla.com/webtech/tips/t071201-1.shtml</a></p>
  
  <p>What I'm trying to achieve is being able to pull in server side variables from our CMS at work into my stylesheet. I realize that SASS and LESS exist and might be able to be adapted, but I'm just trying to find a simple way to use asp variables and pull them into my stylesheet. I'm not super well versed in ASP, so any help you could provide would be helpful.</p>
  
  <p><strong>Edit:</strong> I've updated the code below to reflect the working code.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;link rel="stylesheet" href="&lt;% = TemplatePath %&gt;css/styles.asp" type="text/css" /&gt;
  </code></pre>
  
  <p>ASP CSS page</p>
  
  <pre><code>&lt;%
     dark_color = "navy" 
  %&gt;
  
  &lt;% Response.ContentType = "text/css" %&gt;
  &lt;style type="text/css"&gt;
     h2 { color: &lt;%= dark_color %&gt; }
  &lt;/style&gt;
  </code></pre>