-
-
Save JustCallMeAD/043dab828aad1e21f27c9e4cf7a133cd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Pages constants class | |
public class AdministratorPages | |
{ | |
public const string Base = "/Administrator"; | |
public static string Index = $"{Base}/Index"; | |
public static string EmployeesIndex = $"{Base}/Employees/Index"; | |
} | |
// Usage in a View | |
<a asp-page="@AdministratorPages.Index">Administrator Home Page</a> | |
// Usage in a PageModel for Redirects | |
public IActionResult OnPost() | |
{ | |
// Do something | |
return RedirectToPage(AdministratorPages.Index); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment