My master page has a contentplaceholder in the head tag.
Because I want my page's title to represent the function of the current page and because I want the title to be translated in the user's language I have added a title tag in the page's head's contentplaceholder. All jolly and good except that now there appears a second, empty title tag that off course isn't valid.
Any ideas how to solve this?
Best Answer
According to the W3C spec:
Therefore, the ASP.Net platform is conforming to standards and adding an empty title tag to your page to help you achieve valid markup - it doesn't know you are about to add one through a content placeholder.
Under classic ASP.Net your options are:
If you are using ASP.Net MVC, the default Site.Master file had the following default text:
And the default controller had:
within the action result, again allowing for programmatic access to the page title.
Generally I use the HeadContent content placeholder for adding page specific static scripts and css links.