Embed js, css, images into separate assembly to read from asp.net web site
I'd like to create a class library project where embed resources like js, css and maybe image files. I would compile it and copy the dll into the bin folder of my web site to include the resources into my pages with GetWebResourceUrl.
I tried with an assembly that have no .cs files, but it doesn't seem to work, I can't see the namespace of the assembly in the web project.
Is it possible doing this? Someone could provide a small tutorial?
the best way to embed the files like js , css and ... to dll is to select the embedded resources in build action of file property. take a look at this:
by the way if you want to forbid any kind of unknown requests(out of you web site) to navigate the contents.
If you want to reduce the loading time, serve the media files as static content, as example over nginx.