How to include a client script resource file?

M

mortb

Hi,
I have created an project that defines some custom webcontrols.
Some of them rely on client script functions which I have to send to the
client.
I'd like to know if there is some way of putting them as resource files in
the project so that they will be included in the complied assemby. My goal
is that I will have a file in my project which inlcudes the client script so
that I can alter the file and then read the contents and output its contents
when my controls render, thus not having to put togehter the client sciprt
in my code and not having to deliver a separate file <clientscript.js> which
the user of my control has to put on their server.

Help appreciated,
mortb
 
K

Ken Varn

I wrote an article in codeproject.com that illustrates a method that I use
to do this.

You can find the code and sample project at:

http://www.codeproject.com/aspnet/DynamicContentRendering.asp

Take a look at the EmbeddedJScript class and the example code that uses it.
I basically render the jscript as dynamically rendered content, but you can
also use the class to just load it from a resource and render the script
text manually to the page if you choose.

If you have any questions, feel free to e-mail me on this.

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.

EmailID = varnk
Domain = Diebold.com
 

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,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top