IUrlHelper.IsLocalUrl(String) Metoda

Definice

Vrátí hodnotu, která označuje, jestli je adresa URL místní. Adresa URL se považuje za místní, pokud nemá součást hostitele nebo autority a má absolutní cestu. Adresy URL používající virtuální cesty (~/) jsou také místní.

public:
 bool IsLocalUrl(System::String ^ url);
public bool IsLocalUrl (string url);
public bool IsLocalUrl (string? url);
abstract member IsLocalUrl : string -> bool
Public Function IsLocalUrl (url As String) As Boolean

Parametry

url
String

Adresa URL.

Návraty

Boolean

true , pokud je adresa URL místní; jinak nepravda.

Příklady

Například následující adresy URL jsou považovány za místní:

/Views/Default/Index.html
~/Index.html

Následující adresy URL nejsou místní:

../Index.html
http://www.contoso.com/
http://localhost/Index.html

Platí pro