webcontrol with embedded javasript in assembly

Discussion in 'ASP .Net Building Controls' started by md, Apr 20, 2005.

  1. md

    md Guest

    Hello

    I've created a webcontrol that uses some javascript. Currently i've embbed
    the javascript into the assembly and it's added to the webpage if
    necessary..

    The disadvantage of this approach is that the client can't cache the script
    because it's embedded into the page instead of referenced to an external
    javascript file.

    What's the best way to convert the embedded javascript into an external
    javascript?

    Thanks

    Marco
     
    md, Apr 20, 2005
    #1
    1. Advertisements

  2. md

    lisa Guest

    Is the caching that important?
    A resource server. That works equally well for embedded images and
    embedded files.

    Lisa
     
    lisa, Apr 20, 2005
    #2
    1. Advertisements

  3. md

    lisa Guest

    Check out the thread "IHttpHandler and VS design-time". It looks like
    he made one.

    Lisa
     
    lisa, Apr 20, 2005
    #3
  4. md

    MasterGaurav Guest

    Embedded the JS into assembly itself... yikes would be my first
    response.

    Now that you've already done it... you can add a handler for *.js files

    Look for IHttpHandler or the topic "HTTP Runtime Support" in the docs
    Look for "httpHandler element" index item in the docs.


    --
    Cheers,
    Gaurav Vaish
    http://mastergaurav.org
    http://mastergaurav.blogspot.com
    ---------------------
     
    MasterGaurav, Apr 21, 2005
    #4
  5. md

    lisa Guest

    Can I ask why? I do it all the time.

    Lisa
     
    lisa, Apr 21, 2005
    #5
  6. md

    MasterGaurav Guest

    Why would like to embed a static content?

    It's more time + resource consuming to extract the code from the DLL.
    You'd be using ResourceManager to load the JS dynamically.

    "Dynamically" for static content is the reason for my "no to JS in
    DLL".

    Just have a JS file in a predefined directory. You may like to install
    it in "aspnet_client/<your_dir>". For example:

    - System.Web JS is in aspnet_client/system_web
    - Infragistics puts its JS files in aspnet_client/infragistics


    HTH.


    --
    Cheers,
    Gaurav Vaish
    http://mastergaurav.org
    http://mastergaurav.blogspot.com
    ---------------------
     
    MasterGaurav, Apr 25, 2005
    #6
  7. md

    recoil Guest

    No-Touch deployment would be the ultimate reason I would find this.
    Eliminates the chore of distributing numerous files over repetitively.
    Saves redundant tech support related to users inappropriately deploying
    the component. Anybody that has to deploy 30-200 support files for an
    extremely complex component versus dropping in an assembly that has
    everything probably appreciates the benefit.
     
    recoil, Apr 26, 2005
    #7
  8. md

    md Guest

    Correct! And that's why i was wondering if somebody already had developed
    somehting that has "both worlds"..

    Embed JS into Assembly for easy deployement and when used it should save the
    JS file into the aspclient dir and have some checks to validate up-to-date
    version..

    Thanks

    Marco
     
    md, Apr 28, 2005
    #8
  9. md

    lisa Guest

    lisa, Apr 28, 2005
    #9
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.