Created
June 20, 2018 01:39
-
-
Save scottsauber/fe12d9341463e16ee6fe9fefb32c88b1 to your computer and use it in GitHub Desktop.
This file contains 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