Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 需要从WCF web服务中获取WebResourceURL_Asp.net_Wcf - Fatal编程技术网

Asp.net 需要从WCF web服务中获取WebResourceURL

Asp.net 需要从WCF web服务中获取WebResourceURL,asp.net,wcf,Asp.net,Wcf,我需要从DLL中提取资源。从网页调用时,我使用: return Page.ClientScript.GetWebResourceUrl(this.GetType(), "xxx.ASPNET.Modules.Resources.16.news.png"); 但在WCF中,我显然没有ClientScript属性/ClientScriptManager类型 那么我怎样才能得到一个URL呢?我只能假设这是不可能的,但我想我会问这个问题。在您的wcf服务中,没有什么可以阻止您这样做: System.

我需要从DLL中提取资源。从网页调用时,我使用:

return Page.ClientScript.GetWebResourceUrl(this.GetType(), "xxx.ASPNET.Modules.Resources.16.news.png"); 
但在WCF中,我显然没有ClientScript属性/ClientScriptManager类型


那么我怎样才能得到一个URL呢?我只能假设这是不可能的,但我想我会问这个问题。

在您的wcf服务中,没有什么可以阻止您这样做:

System.Web.UI.Page oPage = new System.Web.UI.Page();
string strURL = oPage.ClientScript.GetWebResourceUrl(typeof(MyClass), "Stuff");

没有任何东西可以阻止您在wcf服务中执行此操作:

System.Web.UI.Page oPage = new System.Web.UI.Page();
string strURL = oPage.ClientScript.GetWebResourceUrl(typeof(MyClass), "Stuff");

谢谢,明白了。顺便说一句,事实证明您不能将数字作为资源标识符的一部分。谢谢,明白了。另外,事实证明,不能将数字作为资源标识符的一部分。