How to include a client script resource file?

Discussion in 'ASP .Net Web Controls' started by mortb, Dec 9, 2004.

  1. mortb

    mortb Guest

    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
     
    mortb, Dec 9, 2004
    #1
    1. Advertising

  2. mortb

    Ken Varn Guest

    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
    -----------------------------------
    "mortb" <mortb1<noospam<@hotmail.com> wrote in message
    news:...
    > 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
    >
    >
     
    Ken Varn, Dec 21, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    551
    Exits Funnel
    Mar 6, 2005
  2. PTM
    Replies:
    1
    Views:
    340
    Andy Dingley
    Nov 12, 2007
  3. naveeddil
    Replies:
    0
    Views:
    591
    naveeddil
    Jan 4, 2008
  4. Andreas Bogenberger
    Replies:
    3
    Views:
    961
    Andreas Bogenberger
    Feb 22, 2008
  5. Eric
    Replies:
    10
    Views:
    484
Loading...

Share This Page