asp.net - load CSS file dynamically renders but doesn't load the CSS file
<p>in my ASP.NET app, I'm trying to add a CSS reference dynamically (with intelligent caching on the client).</p>

<p>My code renders to the browser correctly, but it doesn't load the CSS file.
I have to put the link in my markup explicitly for the CSS file to load, but it won't load when in code behind</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        FileInfo fi = new FileInfo(Server.MapPath("~/Styles/Site.css"));
        HtmlGenericControl link = new HtmlGenericControl("LINK");
        link.Attributes.Add("rel", "stylesheet");
        link.Attributes.Add("type", "text/css");
        link.Attributes.Add("href", "~/Styles/Site.css?t=" + fi.CreationTime.Ticks.ToString());
        Page.Header.Controls.Add(link);
    }
}
</code></pre>

<p>This seems really simple.  Not sure why it isn't working.</p>

<p>NOTE: the attending the fileinfo ticks has no effect on the behavior.  It renders fine but doesn't load regardless of appending the file information.</p>
