I have an ASP.NET Web Application (using Razor pages not controllers) and I am trying to amend the register (identity) page so that once the user has registered (by an admin whos logged in already) it navigates to a Manage roles page and passes the UserId of the user just created.
This is my folder structure:
Currently I'm on the register page which is within the following path:
Areas/Identity/Pages/Account/Register.cshtml
and I am trying to navigate to a page thats simply within the Pages folder: Pages/ManageRoles.cshtml
Here is my code:
return RedirectToPage("./ManageRoles", new { id = user.Id });
but it doesn't work and gives me an error saying No page named './ManageRoles' matches the supplied values. I have also tried the code without the ./ and it still gave me the same error. I have also tried it without the userId part and it still didnt work.
Could someone help me?
Changed it to this and it worked:
return RedirectToPage("/ManageRoles", new { UserId = user.Id });