Logo
Logo
  • Blazor CMS Home
  • Oqtane Tutorials
  • Blazor CMS Home
  • Oqtane Tutorials
Oqtane Tutorials
Oqtane Tutorials

Basics: Linking and URL Parameters

Tutorial Home › Linking
Linking with Number Url Parameters
#3 Linking with Modified Page Parameters
Switch to view by URL
Requirements
  • 2sxc 12.08
Resources
  • Page Parameters
  • Link.To(...)
  • IParameters
Related
  • Working with Page URL Parameters
  • Linking with Modified Page Parameters
  • Linking with Number Url Parameters

Linking with Modified Page Parameters

The samples can differ based on your Razor base class or if you're running an old version.
Switch to Typed (2sxc 16+) Switch to Dynamic (Razor14 or below)

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.

 

 

Linking with Number Url Parameters
#3 Linking with Modified Page Parameters
Switch to view by URL
  • 2sic internet solutions
  • Langäulistrasse 62, 9470 Buchs SG, Switzerland
  • +41 81 750 67 77
Login