#3 Linking with Modified Page Parameters
Linking with Modified Page Parameters
Preserve URL Parameters and More
In Razor page URLs are generated using Link.To(...)
. By default calling Link.To()
without any parameters returns the base URL of the site. In this case it would be: https://app-dev.2sxc.org/tutorial-razor/
.
The key to retrieving the current page URL is to pass the current page parameters. Link.To(parameters: ...)
will then construct the URL based on the passed parameters.
Current page parameters are found in CmsContext.Page.Parameters
.
#3 Linking with Modified Page Parameters