Re: Specifying javascript file path on Master pages



Show us the code that doesn't work?

"Naveen K Kohli" <naveenkohli@xxxxxxxxxxx> wrote in message
news:Og$LT0nKGHA.1032@xxxxxxxxxxxxxxxxxxxxxxx
Already tried that approach. It does not work at all.

"Ken Cox - Microsoft MVP" <BANSPAMkjopc@xxxxxxxxxxx> wrote in message
news:%23o29ONiKGHA.500@xxxxxxxxxxxxxxxxxxxxxxx
Hi Naveen,

The tilde character (~) stands for the site's root when ASP.NET
interprets it. Therefore, you can create a link to your JavaScript that
runs on the server. I

<link runat="server" href="~/scripts/myfile.js" />

With that, every file should find it.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET]


"Naveen K Kohli" <naveenkohli@xxxxxxxxxxx> wrote in message
news:O0g68cgKGHA.2392@xxxxxxxxxxxxxxxxxxxxxxx
I have couple of javascript files that need to be referenced for each
content page. So I am trying to put them on Master page. The problem is
that content pages are not on one level of the site. I have been trying
to find a way to specify path to these JS files so that the actual path
to these files correctly gets applied on the path at every level of the
folder hierarchies. So far no luck...

<script languaage=javascript src="/Scripts/myfile.js" />

Is there any solution to this problem? I have tried to use
Server.MapPath approach to fill src attribute from server side but that
does not fly because it throws exception that controls can't be added or
removed on the page because of theese server tags present on the page..

Any solution to this problem.. I am this close to abandoning use of
master page concept of asp.net 2

Thanks







.



Relevant Pages

  • Re: Specifying javascript file path on Master pages
    ... The tilde character stands for the site's root when ASP.NET interprets ... So I am trying to put them on Master page. ... approach to fill src attribute from server side but that does not fly ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Dynamic DNS and failed journal
    ... SELinux options to allow named to overwrite master zone files. ... My master DNS server can write its master records, and journal files, as ... So /var/named/chroot/var/named is owned by root, ... Mind you, ...
    (Fedora)
  • Re: Specifying javascript file path on Master pages
    ... The tilde character stands for the site's root when ASP.NET interprets ... you can create a link to your JavaScript that runs on the ... So I am trying to put them on Master page. ... approach to fill src attribute from server side but that does not fly ...
    (microsoft.public.dotnet.framework.aspnet)
  • RFX Networks/ RackAdmin.com ALERT
    ... below was posted to some security websites. ... | in security and scalable server management on varying levels. ... Got Root? ... Your Server login ID is: ...
    (comp.os.linux)
  • RFX NETWORKS ALERT
    ... below was posted to some security websites. ... | in security and scalable server management on varying levels. ... Got Root? ... Your Server login ID is: ...
    (alt.linux)