tags:

views:

18

answers:

1

I need to extract a resource from a DLL. When called from a web page, I use:

return Page.ClientScript.GetWebResourceUrl(this.GetType(), "xxx.ASPNET.Modules.Resources.16.news.png"); 

But in WCF, I obviously don't have the ClientScript property/ClientScriptManager type.

So how can I get a URL? I can only assume it cannot be done but thought I'd ask the question.

+1  A: 

Theres nothing stopping you doing this within your wcf service:

System.Web.UI.Page oPage = new System.Web.UI.Page();
string strURL = oPage.ClientScript.GetWebResourceUrl(typeof(MyClass), "Stuff");
Ben Robinson
Thanks, that got it. And as an aside, it turns out you can't use numbers as part of the resource identifier.
Program.X