I am trying to utilize a CSS file from a CDN on my site.master page. The CSS is located at http://cdn.meriranchi.com/styles/site.css. I have tried many variations of the below but am having no luck.
The site.master has the following markup:
<head runat="server">
<title>::MeriRanchi:: Ranchi ka search engine. Ranchi's 1st of its kind, City Search.
Search for the shops, institutes , tourist spots , emergency services etc with ease.
</title>
<link rel="shortcut icon" href="favicon.ico" />
<link rel="stylesheet" id="CssFile" runat="server"/>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
In my code behind I add a href attribute to CssFile:
CssFile.Attributes.Add("href","http://cdn.meriranchi.com/Styles/Site.css");
The above renders the following HTML in IE9:
<head><title>
::MeriRanchi:: Ranchi ka search engine. Ranchi's 1st of its kind, City Search.
Search for the shops, institutes , tourist spots , emergency services etc with ease.
</title><link rel="shortcut icon" href="favicon.ico" /><link id="CssFile" rel="stylesheet" type="text/css" href="http://cdn.meriranchi.com/Styles/Site.css" /><meta name="description" content="schools and colleges in ranchi,restaurants in ranchi,coaching institutes in ranchi,shopping complex in ranchi,shopping mall in ranchi,best cloth store in ranchi
best college in ranchi,best school in ranchi,showrooms in ranchi,authorised dealers in ranchi,grocery stores in ranchi,falls in ranchi,tourist places in ranchi,zoo in ranchi,tourist spots in ranchi,
schools and colleges, BIT Mesra, RINPAS, CIP Ranchi, Ranchi Mental Hospital, HEC, dams in ranchi, jagannathpuri rath mela, hadia, hadiya, hariya, morhabadi maidaan, firayalal chowk,
" /><meta name="keywords" content="tourist places in ranchi, tourist spots in ranchi, business listings in ranchi, shops in ranchi, schools colleges in ranchi, restaurants in ranchi, movies in ranchi, jobs in ranchi,real estate deals in ranchi" />
</head>
More than likely your browser thinks it already has a copy of your externally sourced CSS file. You can check this by watching the network request traffic in your browser’s developer tools to ensure it is requesting a new copy of the file.
If the browser is not you should do a full page refresh by pressing CTRL + F5.