Where to put some javascript?

J

Jim Corey

A longer version of my problem is here:
http://www.developersdex.com/asp/message.asp?p=1116&r=4327903

I have a large amount of javascript that I want to modify
in my code (i.e. a routine called from Page_Load).

I'm trying to figure a relatively easy way to implement this.

It's too unwieldy to try to type it all out in my code.

If I could load it into a string then perhaps that would work -- I could
manipulate the string and then do RegisterClientScriptBlock.

But I can't figure out where to store it.

TIA,
Jim



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
A

Alvin Bruney [MVP]

one approach is to put the code into a js file and reference it in the html
page. then you use your code behind attributes approach to just call methods
into that function. i like this approach because it separates the js cleanly
from the rest of the code.
 
K

Kevin Spencer

Store what? The string with the JavaScript? Do you mean that you want to
persist the JavaScript string across PostBacks? If so, there are numerous
caching options to choose from, depending upon your specific requirements.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top