I need to extract a resource from a DLL. When called from a web page, I use:
return Page.ClientScript.GetWebResourceUrl(th开发者_开发知识库is.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.
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");
精彩评论