Location


How to use the Location class of the bit Butil?

Usage
To use the browser location features you need to inject the Bit.Butil.Location class and use it like this:
@inject Bit.Butil.Location location

@code {
    await location.Reload();
}
Methods

SetHref, GetHref:
Gets/Sets the href of the location and then the associated document navigates to the new page (MDN).



SetProtocol, GetProtocol:
Gets/Sets a string containing the protocol scheme of the URL, including the final ':' (MDN).



SetHost, GetHost:
Gets/Sets a string containing the host, that is the hostname, a ':', and the port of the URL (MDN).



SetHostname, GetHostname:
Gets/Sets the hostname of the location and then the associated document navigates to the new page (MDN).



SetPort, GetPort:
Gets/Sets the port of the location and then the associated document navigates to the new page (MDN).



SetPathname, GetPathname:
Gets/Sets a string containing an initial '/' followed by the path of the URL, not including the query string or fragment (MDN).



SetSearch, GetSearch:
Gets/Sets a string containing a '#' followed by the fragment identifier of the URL (MDN).



SetHash, GetHash:
Gets/Sets the hash of the location and then the associated document navigates to the new page (MDN).



GetOrigin:
Returns a string containing the canonical form of the origin of the specific location (MDN).



Assign:
Loads the resource at the URL provided in parameter (MDN).



Reload:
Reloads the current URL, like the Refresh button (MDN).



Replace:
Replaces the current resource with the one at the provided URL (redirects to the provided URL) (MDN).