RegisterClientScriptInclude and master page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Mathew

    #1

    RegisterClientScriptInclude and master page

    Is there any way to use RegisterClientS criptInclude to generate the
    script tags inside of the <headtag?

    I'm using RegisterClientS criptInclude inside of Page_Load event in the
    code behind for the master page and it generates the tags to the page
    ok, however it puts them inside where the <formtag begins on the
    page and not inside the head tag

    In the code behind:
    cs.RegisterClie ntScriptInclude ("master",
    ResolveClientUr l("~/javascript/master.js"));

    What gets rendered to the browser:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>
    Untitled Page
    </title><link rel="stylesheet " type="text/css" href="../stylesheets/
    main.css" />
    <title>Page Title</title>
    </head>
    <body>
    <form name="aspnetFor m" method="post" action="Default .aspx"
    id="aspnetForm" >
    <script src="../javascript/master.js" type="text/javascript"></
    script>
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: RegisterClientS criptInclude and master page

    no.

    RegisterClientS criptBlock & RegisterClientS criptInclude, always come after
    the form, before any form content. RegisterStartup Script is rendered before
    the closing tag.

    you can put a placeholder inside the <headand render your own script, but
    any server controls will still call the Register routines


    -- bruce (sqlwork.com)


    "Dave Mathew" wrote:
    Is there any way to use RegisterClientS criptInclude to generate the
    script tags inside of the <headtag?
    >
    I'm using RegisterClientS criptInclude inside of Page_Load event in the
    code behind for the master page and it generates the tags to the page
    ok, however it puts them inside where the <formtag begins on the
    page and not inside the head tag
    >
    In the code behind:
    cs.RegisterClie ntScriptInclude ("master",
    ResolveClientUr l("~/javascript/master.js"));
    >
    What gets rendered to the browser:
    >
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head><title>
    Untitled Page
    </title><link rel="stylesheet " type="text/css" href="../stylesheets/
    main.css" />
    <title>Page Title</title>
    </head>
    <body>
    <form name="aspnetFor m" method="post" action="Default .aspx"
    id="aspnetForm" >
    <script src="../javascript/master.js" type="text/javascript"></
    script>
    >

    Comment

    Working...