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

Discussion in 'ASP .Net Building Controls' started by Alexander Walker, Feb 23, 2006.

  1. 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
    Alexander Walker, Feb 23, 2006
    #1
    1. Advertising

  2. 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.)
    Steven Cheng[MSFT], Feb 23, 2006
    #2
    1. Advertising

  3. 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.)
    Steven Cheng[MSFT], Feb 23, 2006
    #3
  4. Thanks Steven, thats a great help
    Alexander Walker, Feb 25, 2006
    #4
  5. You're welcome Alex,

    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.)
    Steven Cheng[MSFT], Feb 27, 2006
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    610
  2. shruds
    Replies:
    1
    Views:
    757
    John C. Bollinger
    Jan 27, 2006
  3. Saumya
    Replies:
    11
    Views:
    4,233
    Datta Patil
    Mar 2, 2004
  4. J055
    Replies:
    5
    Views:
    364
    Steven Cheng[MSFT]
    Nov 2, 2007
  5. Hicham Mouline

    friendship not inheritable

    Hicham Mouline, Nov 14, 2008, in forum: C++
    Replies:
    4
    Views:
    267
    Hicham Mouline
    Nov 17, 2008
Loading...

Share This Page