I wanted to have a style sheet added to an ASP.NET web form which uses a master page. The easiest way is to have the style sheet added to the master page it self inside the "header" tags. But this is not what I wanted... I want to have a common master page for all of my web applications[not only for all the web pages in single web application], so I do not want to add the style sheet to the master page it self. I wanted to have it in the ASP.NET web form which uses the master page.
You can't simply add [link href="StyleSheet.css" rel="stylesheet" type="text/css" /] to the aspx, since this conflicts with the "asp:Content" tag. So, the best way to do this is, add a ContentPlaceHolder to the master page, inside the "header" tag and add content to this ContentPlaceHolder , from the aspx page. This article explains this approach in detail.
The one catch is that 'link' and 'script' references don't get parsed if they are in content pages. They sometimes still work, though, if you don't use nested master pages, URL rewriting, or Server.Transfer.
ReplyDeleteI wrote a patch that simply re-parses link, meta, and script tags that aren't picked up the first time.
Here's how to make scripts, stylesheets, and meta tags work right across the whole application, without having to use different tags or inline code.
Isv r oje y xxx, hot xxx movies. Baj v, ljj zqnphw|qiq qsqskzc f nm we.
ReplyDelete