Adding script block to <head>

Discussion in 'ASP .Net' started by Steve C. Orr [MVP, MCSD], Mar 25, 2005.

  1. 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



    "jsh02_nova" <> wrote in message
    news:...
    > Anybody know how to add a script block to the html <head> section
    > programmatically without using the 'RegisterScriptBlock' functions?
    >
    > --
    >
    > thx
    > -jsh
    >
    >
     
    Steve C. Orr [MVP, MCSD], Mar 25, 2005
    #1
    1. Advertising

  2. Steve C. Orr [MVP, MCSD]

    Showjumper Guest

    Stick an asp:literal control in the head section and then set the text
    property of the literal to your js function.
    "jsh02_nova" <> wrote in message
    news:...
    > Anybody know how to add a script block to the html <head> section
    > programmatically without using the 'RegisterScriptBlock' functions?
    >
    > --
    >
    > thx
    > -jsh
    >
    >
    >
     
    Showjumper, Mar 26, 2005
    #2
    1. Advertising

  3. Steve C. Orr [MVP, MCSD]

    Guest

    We've done a separate control called Linker which is located in <head>
    and is notified by other controls (on prerender phase) when its
    necessary to add link to css or js, or some <script> code.
     
    , Mar 26, 2005
    #3
  4. Steve C. Orr [MVP, MCSD]

    jsh02_nova Guest

    Anybody know how to add a script block to the html <head> section
    programmatically without using the 'RegisterScriptBlock' functions?

    --

    thx
    -jsh
     
    jsh02_nova, Mar 26, 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:
    784
    Brian W
    Jul 2, 2003
  2. showme

    PHP and ASP.NET go HEAD to HEAD

    showme, Jul 8, 2004, in forum: ASP .Net
    Replies:
    13
    Views:
    737
    Sherif ElMetainy
    Jul 10, 2004
  3. Karl
    Replies:
    0
    Views:
    403
  4. Jiho Han

    Write into <HEAD></HEAD> section?

    Jiho Han, Jan 14, 2004, in forum: ASP .Net Building Controls
    Replies:
    6
    Views:
    240
    Sam Fields
    Jan 16, 2004
  5. Water Cooler v2
    Replies:
    2
    Views:
    472
    Water Cooler v2
    Apr 18, 2006
Loading...

Share This Page