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. Advertising

  2. md

    Guest

    md wrote:
    > 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.


    Is the caching that important?

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

    external
    > javascript?


    A resource server. That works equally well for embedded images and
    embedded files.

    Lisa
     
    , Apr 20, 2005
    #2
    1. Advertising

  3. md

    Guest

    wrote:
    > md wrote:
    > > 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.

    >
    > Is the caching that important?
    >
    > > What's the best way to convert the embedded javascript into an

    > external
    > > javascript?

    >
    > A resource server. That works equally well for embedded images and
    > embedded files.


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

    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

    Guest

    MasterGaurav wrote:
    > Embedded the JS into assembly itself... yikes would be my first
    > response.


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

    Lisa

    > 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
    > ---------------------
     
    , 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

    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.
     
    , 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


    "" <> wrote in message
    news:...
    > 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.
    >
     
    md, Apr 28, 2005
    #8
  9. md

    Guest

    Check this out:

    http://groups-beta.google.com/group/microsoft.public.dotnet.framework.aspnet/msg/b886925e4679b0bb

    That should do what you're looking for.

    Lisa

    md wrote:
    > 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
    >
    >
    > "" <> wrote in message
    > news:...
    > > 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.
    > >
     
    , Apr 28, 2005
    #9
    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. AAaron123
    Replies:
    5
    Views:
    326
    AAaron123
    Aug 18, 2008
  2. Jay

    UserControl and Javasript

    Jay, Apr 5, 2005, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    112
    Steve C. Orr [MVP, MCSD]
    Apr 5, 2005
  3. monika
    Replies:
    2
    Views:
    193
    karim dahdah
    Sep 5, 2003
  4. techy techno

    how can I give Css in Javasript document.Write

    techy techno, Feb 23, 2004, in forum: ASP General
    Replies:
    1
    Views:
    533
    Bullschmidt
    Feb 23, 2004
  5. Bartosz Wegrzyn

    javasript problem - submiting

    Bartosz Wegrzyn, Sep 8, 2003, in forum: Javascript
    Replies:
    7
    Views:
    143
    Bartosz Wegrzyn
    Sep 8, 2003
Loading...

Share This Page