Javascript going to the wrong place?

Discussion in 'ASP .Net' started by shapper, Nov 24, 2007.

  1. shapper

    shapper Guest


    I used the following:

    "Wait", "~/App_Scripts/Wait.js")
    Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "Hello",
    "Alert('Hello World');", True)

    On Page_Load (also tried Page_Init and Page_Prerender)

    In both cases the reference and the script were placed inside the
    <body> tag?

    Shouldn't it be in the <head> tag?

    How can I solve this?

    My rendered HTML code:

    <form name="form1" method="post" action="Default.aspx" id="form1">
    <input name="__VIEWSTATE" id="__VIEWSTATE" value="/
    wEPDwUJMTk5MjU0MTcwZGTUsWGyZF9Fo8xcBZKocDiHxhClIA==" type="hidden">
    <script src="%7E/App_Scripts/JQuery.js" type="text/javascript">
    <script type="text/javascript">
    alert('Hello World)'$(document).ready(function(){


    shapper, Nov 24, 2007
    1. Advertisements

  2. Why? What difference does it make?
    Is your JavaScript not working, then...?
    Mark Rae [MVP], Nov 24, 2007
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.