site.master ページで CDN から CSS ファイルを利用しようとしています。CSS は にありhttp://cdn.meriranchi.com/styles/site.css
ます。以下の多くのバリエーションを試しましたが、うまくいきません。
site.master には次のマークアップがあります。
<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>
私のコードビハインドでは、href 属性を に追加しますCssFile
。
CssFile.Attributes.Add("href","http://cdn.meriranchi.com/Styles/Site.css");
上記は、IE9 で次の HTML をレンダリングします。
<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>