IResourceUrlGenerator 接口


定义一个方法,设计器宿主必须实现该方法来为嵌入式资源提供 URL 引用查找。Defines the method that a designer-host must implement to provide URL reference look-up for embedded resources.

public interface class IResourceUrlGenerator
public interface IResourceUrlGenerator
type IResourceUrlGenerator = interface
Public Interface IResourceUrlGenerator


ASP.NET 版本2.0 提供从控件(如 Page 控件)的程序集中检索嵌入资源的功能。ASP.NET version 2.0 provides the ability to retrieve embedded resources from an assembly for controls, such as the Page control. 在运行时,可以使用 ClientScriptManager 类的 GetWebResourceUrl 方法检索嵌入资源的 URL。At run time, the URL to the embedded resource can be retrieved using the GetWebResourceUrl method of the ClientScriptManager class. 为了提供从程序集生成资源 URL 的设计时方法,设计器宿主可以提供实现 IResourceUrlGenerator 接口的服务。To provide a design-time means for generating a resource URL from an assembly, designer hosts can offer a service that implements the IResourceUrlGenerator interface. 更多相关信息:For more information:

IResourceUrlGenerator 接口有一种方法,即 GetResourceUrl 方法,该方法返回给定资源类型和名称的对资源的 URL 引用。The IResourceUrlGenerator interface has one method, the GetResourceUrl method, that returns a URL reference to a resource given the resource type and name.


GetResourceUrl(Type, String)

返回对嵌入式资源(位于在设计时使用的程序集中)的 URL 引用。Returns a URL reference to an embedded resource in an assembly that is used at design time.