Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > How to include a client script resource file?

Reply
Thread Tools

How to include a client script resource file?

 
 
mortb
Guest
Posts: n/a
 
      12-09-2004
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


 
Reply With Quote
 
 
 
 
Ken Varn
Guest
Posts: n/a
 
      12-21-2004
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/Dy...tRendering.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
-----------------------------------
"mortb" <mortb1<noospam<@hotmail.com> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
/* #include <someyhing.h> */ => include it or do not include it?That is the question .... Andreas Bogenberger C Programming 3 02-22-2008 10:53 AM
Very annoying error: Access to the path is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity Jay ASP .Net 2 08-20-2007 07:38 PM
Resource manager problem: naming for embedded resource. Dirc Khan-Evans ASP .Net 1 10-17-2005 12:52 PM
The system cannot locate the resource specified. Error processing resource avishosh XML 2 08-08-2004 06:28 AM



Advertisments