Program.X
Program.X

Reputation: 7412

Need to GetWebResouceUrl from within a WCF web service

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.

Upvotes: 1

Views: 62

Answers (1)

Coding Flow
Coding Flow

Reputation: 21881

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");

Upvotes: 1

Related Questions