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
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