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 fol开发者_JAVA技巧der 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?
Thanks
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:
http://hasantechno.blogspot.com/2011/04/aspnet-embedding-resources-image-css.html
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.
精彩评论