Control.ResolveClientUrl(String) 方法

定義

取得瀏覽器可使用的 URL。Gets a URL that can be used by the browser.

public:
 virtual System::String ^ ResolveClientUrl(System::String ^ relativeUrl);
public string ResolveClientUrl (string relativeUrl);
abstract member ResolveClientUrl : string -> string
override this.ResolveClientUrl : string -> string
Public Function ResolveClientUrl (relativeUrl As String) As String

參數

relativeUrl
String

相對於目前頁面的 URL。A URL relative to the current page.

傳回

適合瀏覽器使用、指定之資源的完整 URL。A fully qualified URL to the specified resource suitable for use on the browser.

實作

例外狀況

relativeUrlnullrelativeUrl is null.

備註

使用 ResolveClientUrl 方法,傳回適合用戶端用來存取網頁伺服器上資源的 URL 字串,例如影像檔、其他頁面的連結等等。Use the ResolveClientUrl method to return a URL string suitable for use by the client to access resources on the Web server, such as image files, links to additional pages, and so on.

注意

這個方法所傳回的 URL 會相對於包含具現化控制項之原始程式檔的資料夾。The URL returned by this method is relative to the folder containing the source file in which the control is instantiated. 繼承這個屬性的控制項(例如 UserControlMasterPage)將會傳回相對於控制項的完整 URL。Controls that inherit this property, such as UserControl and MasterPage, will return a fully qualified URL relative to the control.

適用於