Friday, 2 January 2009

Blank <title> tags

If you are using ASP.NET and placehoders to render your metadata. You may notice that it will generate an empty <title> tag. This occurs when using XHTML 1.0 Transitional. I often use placeholders to control the content with in the title tag.

To overcome this, you can add the following in the head tag.

<title visible="false" runat="server"></title>

This turns the <title> tag into a server control, and the visible attribute prevents the blank title from rendering to the page.

No comments: