Class Location

Class Location

Namespace: Aspose.Html.Window
Assembly: Aspose.HTML.dll (25.2.0)

Location objects provide a representation of the address of the active document of their Document’s browsing context, and allow the current entry of the browsing context’s session history to be changed, by adding or replacing entries in the history object.

[ComVisible(true)]
[DOMObject]
[DOMName("Location")]
public sealed class Location : DOMObject, INotifyPropertyChanged

Inheritance

objectDOMObjectLocation

Implements

INotifyPropertyChanged

Inherited Members

DOMObject.GetPlatformType(), object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Properties

Hash

Returns the Location object’s URL’s fragment (includes leading “#” if non-empty). Can be set, to navigate to the same URL with a changed fragment(ignores leading “#”).

[DOMName("hash")]
public string Hash { get; set; }

Property Value

string

Host

Returns the Location object’s URL’s host and port (if different from the default port for the scheme). Can be set, to navigate to the same URL with a changed host and port.

[DOMName("host")]
public string Host { get; set; }

Property Value

string

Hostname

Returns the Location object’s URL’s host. Can be set, to navigate to the same URL with a changed host.

[DOMName("hostname")]
public string Hostname { get; set; }

Property Value

string

Href

Returns the Location object’s URL. Can be set, to navigate to the given URL.

[DOMName("href")]
public string Href { get; set; }

Property Value

string

Origin

Returns the Location object’s URL’s origin.

[DOMName("origin")]
public string Origin { get; }

Property Value

string

Pathname

Returns the Location object’s URL’s path. Can be set, to navigate to the same URL with a changed path.

[DOMName("pathname")]
public string Pathname { get; set; }

Property Value

string

Port

Returns the Location object’s URL’s port. Can be set, to navigate to the same URL with a changed port.

[DOMName("port")]
public string Port { get; set; }

Property Value

string

Protocol

Returns the Location object’s URL’s scheme. Can be set, to navigate to the same URL with a changed scheme.

[DOMName("protocol")]
public string Protocol { get; set; }

Property Value

string

Search

Returns the Location object’s URL’s query (includes leading “?” if non-empty). Can be set, to navigate to the same URL with a changed query(ignores leading “?”).

[DOMName("search")]
public string Search { get; set; }

Property Value

string

Methods

Assign(string)

Navigates to the given page.

[DOMName("assign")]
public void Assign(string url)

Parameters

url string

The URL to navigate.

Reload()

Reloads the current page.

[DOMName("reload")]
public void Reload()

Replace(string)

Removes the current page from the session history and navigates to the given page.

[DOMName("replace")]
public void Replace(string url)

Parameters

url string

The string URL to navigate.

ToString()

Returns the Location object’s URL.

public override string ToString()

Returns

string

Returns the Location object’s URL string value.