开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜