HtmlHead is not inheritable how can I prevent the <title> tag from rendering?

A

Alexander Walker

Hello

I am trying to prevent the <title> tag from rendering in an HtmlHead control.
How can I do this?

I have been trying to replace it with a web user control that I have created
which renders the title tag and takes advantage of caching features

My main problem is that the HtmlHead control renders the <title> tag even though
my web user control has already rendered the <title> tag

This doesn't cause any problems in the web browser but it doesn't validate as
xhtml transitional, I want to the page to render as valid xhtml transitional so
I have to make sure that there isn't a duplicate <title> in the <head>

What can I do?

Alex
 
S

Steven Cheng[MSFT]

Hi Alex,

Thanks for posting.

As for the HtmlHead's title generation problem, are you using ASP.NET 1.1
or 2.0 for your application currently? If you're using ASP.NET 2.0 page, t
he HtmlHead property of the Page class will always render out the Title
element and so far what I've tried is setting the "Header" property's
Visible property to false which will make the entire <head> section not
rendered. If you can completely put your own control to render the head
section, this will be one possible approach.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Well, I've just tested and found that you can manually locate the "Title"
sub control in the Page.Header.Controls collection which is of HtmlTitle
type. Then, just set its Visible to false to prevent it from being rendered.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,539
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top