This is a 2 step process: First, we make a DLL which contains those resource files, then we use them on our HTML page.
1) Make a new Class Library project, add a reference to System.Web and some resources. It should look like this (I added a .js and a .jpg file):
2) Open Class1.cs and add the following code:
The AspNetHostingPermission attribute controls access permissions in ASP.NET hosted environments.
3) Change the Build Action of both resource files to Embedded Resource:
4) Build the project.
5) Open your web site project, right-click and add a reference to this DLL we just built.
6) There are a few ways you can reference those resources on your HTML markup. You can wither do it on code-behind, which I prefer:
You can also paste the resource URL (given by GetWebResourceUrl()) directly onto your HTML markup without using ScriptManager or code-behind.
Different versions of ASP.NET will require extra work, this example was done in ASP.NET 4.
In case it doesn’t work, make sure you have the HttpHandler entry on your web.config as described here