M# Tutorials

Learn to build .NET applications with M#. Our step-by-step tutorials will get you up-to-speed rapidly.
If you already know ASP.NET and C#, you can master M# in a week or two.

Understanding Page Key

Page resource keys are used in M# to get the relative path of pages and is used to navigate between pages. M# manages the Sitemap of the website and displays all the pages using the resource key, which is also used to resolve relative URL of pages. Below is the Sitemap and list of pages in our “HelloWorld” project.

Changing Page Keys

As mentioned earlier, page resource keys are used by M# to perform redirection between pages. Below is the code that M# generates for page redirection using a page resource key.

Response.Redirect(PageUrl("Employees > Profile"));

The default value of the page key represents the path of the page in M# page hierarchy. If the page is moved to another location within the hierarchy (by changing its Parent) the key gets updated to the new path. However, you can give the page a fixed key, so M# does not update the key if the page is relocated.