Jeff,
Instead of using the RegisterClientScriptBlock (which is tagged as
obsolete) why not just use the RegisterClientScriptInclude method on the
ClientScriptManager class? You don't need to write the script, you just
would have to include the url of the script to include.
Also, I notice you are using a relative URL. If this is a master page,
and it is going to be used for pages across different directories, then the
URL is constantly going to change. You might want to make the URL relative
to the root, using "/JavaScript/sscroller.js" (note the initial slash).
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"jeff3048" <je******@discussions.microsoft.comwrote in message
news:52**********************************@microsof t.com...
Hi,
I want to incorporate a JavaScript routine (found on the internet) in my
page that will restore the scrollbar position of a div tag on postback. I
am
using master pages which complicates things and also want to reference the
script via a ".js" file. Below is the code I have come-up with but it
doesn't work (I get a blank screen). The script is located in the project
folder in the JavaScript folder. Any ideas?
Thanks,
Jeff
Page.RegisterClientScriptBlock("MyScript", "<script
language=javascript src='JavaScript/sscroller.js'>");