In my web application I include all of my JavaScripts as js files that are embedded resources in the assembly, and add them to the page using ClientScriptManager.GetWebResourceUrl(). However, in some of my js files, I have references to other static assets like image urls. I would like to make those assembly resources as well. Is there a way to tokenize the reference to the resource? e.g.
this.drophint = document.createElement('img'); this.drophint.src = '/_layouts/images/dragdrophint.gif';
Could become something like:
this.drophint = document.createElement('img'); this.drophint.src = '{resource:assembly.location.dragdrophint.gif}';
I’d suggest that you emit the web resources as a dynamic javascript associative array.
Server side code:
Then your client side code looks like this:
Hope this helps.