Thanks for looking at WebResource again, but not understanding how this works. It was just a different look, and now I have a small solution.
For those interested, I have a class in my DLL called Resource, with a static method as follows
public static string Get(Page p, string file) { return p.ClientScript.GetWebResourceUrl(typeof(Resource), typeof(Resource).Namespace + ".Resources." + file); }
After using the register directive on my main page (or web.config) I can now do the following
<link href="<%= Resource.Get(this.Page, "Styles.reset.css") %>" rel="stylesheet" type="text/css" />
(reset.css is located in the folder named Styles in the dll, and therefore Styles.filename.css)
Important notes:
I found that the first argument accepted by GetWebResourceUrl should be a class inside a dll project not a class inside the website being used.
I also had enormous difficulty in determining the correct name to use for the resource in the AssemblyInfo.cs file. I found that my assembly name does not match my default namespace. The default namespace should be used to form the argument 'resourceName' for GetWebResourceUrl.
source share