RegisterClientScriptInclude and master page

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Is there any way to use RegisterClientScriptInclude to generate the
script tags inside of the <head> tag?

I'm using RegisterClientScriptInclude 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 <form> tag begins on the
page and not inside the head tag

In the code behind:
cs.RegisterClientScriptInclude("master",
ResolveClientUrl("~/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="aspnetForm" method="post" action="Default.aspx"
id="aspnetForm">
<script src="../javascript/master.js" type="text/javascript"></
script>
.


Quantcast