Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / February 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Walker - 23 Feb 2006 03:56 GMT
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
Steven Cheng[MSFT] - 23 Feb 2006 11:25 GMT
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

Signature

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

Steven Cheng[MSFT] - 23 Feb 2006 11:45 GMT
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

Signature

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

Alexander Walker - 25 Feb 2006 01:34 GMT
Thanks Steven, thats a great help
Steven Cheng[MSFT] - 27 Feb 2006 01:26 GMT
You're welcome Alex,

Regards,

Steven Cheng
Microsoft Online Support

Signature

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.