ASP.NET Tip: How to prevent the title tag from rendering

Published:

Updated:

In ASP.NET, those who want complete control over the contents of the <head> section of a page get frustrated by the fact that ASP.NET automatically inserts a <title> tag.

You can even set Me.Page.Title to String.Empty, and it will still generate and render a <title> tag.

The answer is maddeningly simple:

Put a <title> tag into the <head> section as follows:

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

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

Entry #3

Comments

This Blog entry currently has no comments.

Post a Comment

Please Log In

To use this feature you must be logged into your Lottery Post account.

Not a member yet?

If you don't yet have a Lottery Post account, it's simple and free to create one! Just tap the Register button and after a quick process you'll be part of our lottery community.

Register