Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.net Web Resources vs. Images

Tags:

asp.net

Okay, so ASP.net allows one to embed Images into an Assembly and access them using WebResource.axd.

I just wonder: What are the Pros/Cons of using Web Resources instead of Images in a folder on the Web Server, like how it's being traditionally done?

This article mainly mentions ease of deployment, but that doesn't seem to justify the extra amount of work.

like image 896
Michael Stum Avatar asked Feb 28 '23 20:02

Michael Stum


2 Answers

One clear scenario is: third party controls.

I really don't want to deal with different script/image files for controls we are not developing. With embedded resources, its just the .dll file and that's it :).

The same applies if you are developing custom web controls that you will be using across different web sites.

like image 108
eglasius Avatar answered Mar 05 '23 15:03

eglasius


I built custom controls that used by three different applications in same machine. When I maintain scripts for controls, I can forget deploying the new script file to every application.

In this scenario, it's good to embed resources into assembly and deploy assembly to GAC.

But the good point about external files (not embedding resources) is that, sometimes you realize a bug in script files. deploying it without resetting application is a good thing in an online application.

like image 31
Canavar Avatar answered Mar 05 '23 15:03

Canavar