Matthew,
Using Response.Write will work, but you have no control over where the
script is written unless you use inline script delimiters. A better option
would be to use RegisterClientScriptBlock or RegisterStartupScript along
with a StringBuilder object to dynamically build your script. Bear in mind
that if you know what the script needs to be, you can just add it to HTML
view as you would with an HTML file. You would only need to use
server-side code for your script if you need to programmtically write your
script.
Jim Cheshire, MCSE, MCSD [MSFT]
Developer Support
ASP.NET
(e-mail address removed)
This post is provided as-is with no warranties and confers no rights.
--------------------