Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > webcontrol with embedded javasript in assembly

Reply
Thread Tools

webcontrol with embedded javasript in assembly

 
 
md
Guest
Posts: n/a
 
      04-20-2005
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


 
Reply With Quote
 
 
 
 
lisa@starways.net
Guest
Posts: n/a
 
      04-20-2005

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

 
Reply With Quote
 
 
 
 
lisa@starways.net
Guest
Posts: n/a
 
      04-20-2005

(E-Mail Removed) 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

 
Reply With Quote
 
MasterGaurav
Guest
Posts: n/a
 
      04-21-2005
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
---------------------

 
Reply With Quote
 
lisa@starways.net
Guest
Posts: n/a
 
      04-21-2005

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


 
Reply With Quote
 
MasterGaurav
Guest
Posts: n/a
 
      04-25-2005
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
---------------------

 
Reply With Quote
 
recoil@community.nospam
Guest
Posts: n/a
 
      04-26-2005
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.

 
Reply With Quote
 
md
Guest
Posts: n/a
 
      04-28-2005
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


"(E-Mail Removed)" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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.
>



 
Reply With Quote
 
lisa@starways.net
Guest
Posts: n/a
 
      04-28-2005
Check this out:

http://groups-beta.google.com/group/...86925e4679b0bb

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
>
>
> "(E-Mail Removed)" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> > 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.
> >


 
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
Whay's wrong with this javasript statement? AAaron123 ASP .Net 5 08-18-2008 06:29 PM
UserControl and Javasript Jay ASP .Net Building Controls 1 04-05-2005 09:46 PM
how can I give Css in Javasript document.Write techy techno ASP General 1 02-23-2004 09:29 AM
javasript problem - submiting Bartosz Wegrzyn Javascript 7 09-08-2003 10:53 PM
want to open a new window on button click!-jscript or javasript monika ASP General 2 09-05-2003 08:52 AM



Advertisments