possible to render into the <HEAD> section?

Discussion in 'ASP .Net' started by PJ6, Sep 5, 2005.

  1. PJ6

    PJ6 Guest

    I want to render this text into the <HEAD> section of a page (and perhaps
    mute any existing title declaration, or alter it to be this instead) -

    <title runat="server" id=HtmlTitle></title>

    It seems Render only sends items into the <BODY>.

    Actually, it would be nice if I had control over the entire rendering
    process, including the whole <HEAD>.

    It what I want to do possible?

    Paul
    PJ6, Sep 5, 2005
    #1
    1. Advertising

  2. You can do this. I do it all the time. Just reference it as an
    HtmlGenericControl in your code and it should be fine.

    Hope this helps,
    Mark Fitzpatrick
    Microsoft MVP - FrontPage

    "PJ6" <> wrote in message
    news:%...
    >I want to render this text into the <HEAD> section of a page (and perhaps
    >mute any existing title declaration, or alter it to be this instead) -
    >
    > <title runat="server" id=HtmlTitle></title>
    >
    > It seems Render only sends items into the <BODY>.
    >
    > Actually, it would be nice if I had control over the entire rendering
    > process, including the whole <HEAD>.
    >
    > It what I want to do possible?
    >
    > Paul
    >
    Mark Fitzpatrick, Sep 5, 2005
    #2
    1. Advertising

  3. PJ6

    Brock Allen Guest

    Yes, this is possible. The approach I've taken in the past is to create my
    own custom control that I place at the top of the document, right after the
    <html> element. My custom control then is responsible for rendering <head>
    and anything else I want in the <head>. Each page controls what is emitted
    based upon properties on my custom head control. So, yep, it's possible;
    it's just code, so make it do what you want :)

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I want to render this text into the <HEAD> section of a page (and
    > perhaps mute any existing title declaration, or alter it to be this
    > instead) -
    >
    > <title runat="server" id=HtmlTitle></title>
    >
    > It seems Render only sends items into the <BODY>.
    >
    > Actually, it would be nice if I had control over the entire rendering
    > process, including the whole <HEAD>.
    >
    > It what I want to do possible?
    >
    > Paul
    >
    Brock Allen, Sep 5, 2005
    #3
  4. Put this in the HTML view of your header section:

    <%=MyScriptBlockFunction()%>

    Then define MyScriptBlockFunction to return whatever script text you'd like.

    --
    I hope this helps,
    Steve C. Orr, MCSD, MVP
    http://SteveOrr.net


    "PJ6" <> wrote in message
    news:%...
    >I want to render this text into the <HEAD> section of a page (and perhaps
    >mute any existing title declaration, or alter it to be this instead) -
    >
    > <title runat="server" id=HtmlTitle></title>
    >
    > It seems Render only sends items into the <BODY>.
    >
    > Actually, it would be nice if I had control over the entire rendering
    > process, including the whole <HEAD>.
    >
    > It what I want to do possible?
    >
    > Paul
    >
    Steve C. Orr [MVP, MCSD], Sep 6, 2005
    #4
    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. Brian W
    Replies:
    10
    Views:
    756
    Brian W
    Jul 2, 2003
  2. Sergey Morkovkin
    Replies:
    5
    Views:
    17,284
    gamcfarlane
    Jul 14, 2009
  3. showme

    PHP and ASP.NET go HEAD to HEAD

    showme, Jul 8, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    711
    Sherif ElMetainy
    Jul 10, 2004
  4. Jiho Han

    Write into <HEAD></HEAD> section?

    Jiho Han, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    221
    Sam Fields
    Jan 16, 2004
  5. Sergey Morkovkin

    Insert SCRIPT or LINK tag into a HEAD section DYNAMICALLY

    Sergey Morkovkin, Sep 11, 2003, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    184
    Slava Tihonyuk
    Sep 15, 2003
Loading...

Share This Page