IUrlResolutionService 接口


定义一种服务,该服务由对象实现以根据上下文信息解析相对 URL。Defines a service implemented by objects to resolve relative URLs based on contextual information.

public interface class IUrlResolutionService
public interface IUrlResolutionService
type IUrlResolutionService = interface
Public Interface IUrlResolutionService


此接口定义用于解析 URL 路径的服务。This interface defines the service that is used to resolve URL paths. IUrlResolutionService接口用于解析相对路径和包含 ~ 运算符的路径。The IUrlResolutionService interface is used for resolving relative paths and paths that contain the ~ operator. 引用资源的服务器控件可以通过 ~ 运算符定义资源的路径, 该运算符表示当前应用程序的根目录。Server controls that reference resources can define the paths to the resources through the ~ operator, which represents the root of the current application. 如果传递到浏览器, 包含 ~ 运算符的路径将不起作用。A path containing the ~ operator will not work if passed to the browser. 在将路径传递给浏览器之前, 服务器控件必须将路径转换为绝对路径或相对路径。The server control must convert the path to an absolute or relative path before passing it to the browser.

Control实现此接口。Control implements this interface. 派生自Control的控件可能会重写此实现, 以提供 url 的自定义解析。A control that derives from Control could override this implementation to provide customized resolution of URLs.



返回适合由客户端使用的已解析的 URL。Returns a resolved URL that is suitable for use by the client.