How can I let VS.NET 2005 parse .js files?

F

Friso Wiskerke

Hi all,

Instead of placing the Javascript in an page we've put the script in a
separate .js file and reference it from the page where it's being used using
a <script language="js" src="js/myscript.js" type="text/javascript"> tag.
This works fine in regular sites but when you want to use master pages, what
ofcourse we want, it will not function anymore.

We encoutered the phenomenon called "name mangling" when using master pages.
To work around it you have to use inline asp script in your Javascript to
get the correct name (eg. <% txtSubject.ClientID %>). When the Javascript
in inside the ASPX page this parsed and .NET replaces the <% %> tags with
the correct name. But our script is in a separate .js file which apparently
is not parsed by the .NET engine.

Is there a way to tell VS to parse .js files also? Or is there another way
to get our script working?

TIA,
Friso Wiskerke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top