I'm starting a new project using asp.net Core 2 with Identity, and would like to change the Razor pages Register.cshtml
and Register.cshtml.cs
pages to Signup.cshtml
and Signup.cshtml.cs
. However, after doing so, the page will show validation errors but will not submit and I cannot hit a breakpoint in the OnPostAsync
. Is there something going on "under the hood" that prevents this from working?
0
votes
I suspect this doesn't have anything to do with Razor Pages at all. It seems to be a client-side issue. Perhaps some broken JS. Something is actually preventing the submit button from working properly. You might even just have a client-side validation error that's not exposing a validation message, so you can't tell there's actually an error.
– Chris Pratt
Thanks @ChrisPratt, some bad Javascript was the cause.
– PixelPaul
1 Answers
0
votes
After scaffolding Identity to your project , rename the Register.cshtml
to Signup.cshtml
won't work since the Register
button will still redirect to /Identity/Account/Register
, which is controlled by Identity RCL after renaming .
You can modify the _LoginPartial.cshtml
, and change the link to :
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Signup">Register</a>
So that it will use the Signup
page .