How to set path to the WebForm JavaScript file

M

Michael Nemtsev, MVP

Hello Mike,

use the desired path at src attribute (<script type="text/javascript" src="my.js"></script>)
or consider using "OnDemand" JS pattern http://ajaxpatterns.org/On-Demand_Javascript


---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog: http://spaces.live.com/laflour

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo


M> to load the WebForm JavaScript from my own location instead of the
M> resource URL
M>
 
M

Mike via DotNetMonster.com

I know how to add a custom JavaScript. In my case I need to change the
location of the default MS WebForm JavaScript files (the ones that store
methods for the form postback/calbacks and the ASP.NET validators). In .NET 2.
0 these files stored in the System.Web.dll, however I need to load these
files from my own location.
 
M

Mike via DotNetMonster.com

I believe .NET 1.0 had a special tables for these standard JavaScript files,
however since .NET 2.0 they were moved to the Web assembly and now <form
runat="server"> generates something like this <script src="/WebResource.axd?
d=4vyf787asdY8c9h_cvayUuA2&amp;t=633236395245382000"></script>, while I need
to make it <script src="htttp://mydomain/asp_net_standard_js_files/MSWebForms.
js"/></script>



I know how to add a custom JavaScript. In my case I need to change the
location of the default MS WebForm JavaScript files (the ones that store
methods for the form postback/calbacks and the ASP.NET validators). In .NET 2.
0 these files stored in the System.Web.dll, however I need to load these
files from my own location.
Hello Mike
[quoted text clipped - 5 lines]
Using a script tag with the path?
 
M

Mike via DotNetMonster.com

I believe .NET 1.0 had a special tables for these standard JavaScript files,

Sorry, I made a typo in previous message.

special tables = special folder
 
P

Peter Bucher [MVP]

Hello Mike
I believe .NET 1.0 had a special tables for these standard JavaScript
files,
however since .NET 2.0 they were moved to the Web assembly and now <form
runat="server"> generates something like this [...] while I need
to make it <script
src="htttp://mydomain/asp_net_standard_js_files/MSWebForms.
js"/></script>
Okay...

I dont know this yet, sorry.
But let me ask you a question: Why you want that include name, what reason?

(If it have to be that name - what reasen ever - you can add it manually,
additional to the original include.)
 
M

Mike via DotNetMonster.com

My site has lots of subdomains. Since asp.net generates paths that start with
"/", the user browser will download multiple copies of the same JavaScript.
So, I need to render the full URL that includes not just the path but the
domain name as well.


Hello Mike
I believe .NET 1.0 had a special tables for these standard JavaScript
files,
[quoted text clipped - 3 lines]
src="htttp://mydomain/asp_net_standard_js_files/MSWebForms.
js"/></script>
Okay...

I dont know this yet, sorry.
But let me ask you a question: Why you want that include name, what reason?

(If it have to be that name - what reasen ever - you can add it manually,
additional to the original include.)
 

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

Top