Part ~ the file path (which means "application root") is not recognized on the client side.
You have two options: generate the server side <link> on the server side ( runat="server" ) and fill in the href attribute here (where ~ recognized using Page.ResolveUrl() )) or, alternatively, build the corresponding relative path, which does not include tilde (which is probably more efficient).
Relative path
Perhaps you just need to lose the tilde ( ~ ) if the application is hosted at the root level of the domain:
<link href="/input/docgenix.css" rel="stylesheet" type="text/css" />
Server side solution:
This will work regardless of whether the web application is hosted at the root domain level or inside the folder ( mysite.com/myapp vs mysite.com ), but probably a little less efficient.
In the markup:
<link id="lnk" runat="server" rel="stylesheet" type="text/css" />
and in code:
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { lnk.Attributes["href"] = Page.ResolveUrl("~/input/docgenix.css"); } }
(Note: this is not verified)
source share