On Jun 4, 1:31 pm, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.com> wrote:
> You can use the RegisterClientScriptInclude methodhttp://msdn2.microsoft.com/en-us/library/kx145dw2.aspx
> if necessary, along with the ResolveUrl helper method.
> Peter
>
> --
> Site: http://www.eggheadcafe.com
> UnBlog: http://petesbloggerama.blogspot.com
> Short urls & more: http://ittyurl.net
>
>
>
> "Joey" wrote:
> > I have the following in the head section of the ASPX page for my
> > master page:
>
> > <script language="javascript" type="text/javascript"
> > src="MyCodeFile.js"></script>
>
> > This includes my external javascript code file for my master page and
> > all subscribing pages. But I ran into a problem. This only works for
> > pages in the root directory of the site. The (relative) path is wrong
> > for pages in other folders on the website.
>
> > I tried using src="/MyCodeFile.js", but that doesn't work. I
> > understand that if I was using a server control I could use src="~/
> > MyCodeFile.js".
>
> > So what is the best way to handle this?- Hide quoted text -
>
> - Show quoted text -
Could you provide an example for how to do this?
I am familiar with ClientScript.RegisterStartupScript(), etc...I use
it to register scripts located in my external javascript file. But how
do I register the file itself?