Javascript going to the wrong place?

S

shapper

Hello,

I used the following:

Page.ClientScript.RegisterClientScriptInclude(Me.GetType(),
"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:

<head>
<title>
Default
</title>
</head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input name="__VIEWSTATE" id="__VIEWSTATE" value="/
wEPDwUJMTk5MjU0MTcwZGTUsWGyZF9Fo8xcBZKocDiHxhClIA==" type="hidden">
</div>
<script src="%7E/App_Scripts/JQuery.js" type="text/javascript">
</script>
<script type="text/javascript">
//<![CDATA[
alert('Hello World)'$(document).ready(function(){
$('#tableone').tableHover();
});
//]]>
</script>
</form>
</body>

Thanks,

Miguel
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top