I have an OnPost function of the form
public IActionResult OnPost()
{
//Do some stuff
return RedirectToPage("/Forms/Strategy");
}
This works properly and the RedirectToPage opens the Razor page at the top. However, I would prefer the Redirect to open the Forms/Strategy page with a specific anchor point at the top of the browser window. That anchor is:
<h3><a id="RedirectTarget">Redirect Target</a></h3>
I have tried using a RedirectToPage of the form:
return RedirectToPage("/Forms/Strategy#RedirectTarget");
However, this results in an error:
InvalidOperationException: No page named '/Forms/Strategy#returnstable' matches the supplied values.
I assume I am incorrectly structuring the URL for the RedirectToPage.