Reputation: 20606
You are able to redirect to other actions using built-in methods like:
RedirectToPage("./Index", new { StatusMessage = "Everything was processed successfully"" });
This will redirect to another PageModel
that's in same directory and it's Index action. Is it possible to "extract" this functionality so that you get redirect location by just passing ./Index
to some util function/method?
Upvotes: 0
Views: 247
Reputation: 2321
public class IndexModel : PageModel
{
public void OnGet()
{
string privacyPageUrl = Url.Page("./Privacy");
}
}
Upvotes: 2