This is ASP.NET Razor Pages Project with ASP.NET Identity Registration Page (.NET 8).
Email checking (PageRemore) works fine, but only if the Email property is not a member of the Input class (automatically generated by ASP.NET Identity)
[BindProperty]
[Required]
[EmailAddress]
[Display(Name = "Email")]
[PageRemote(
ErrorMessage = "This email is already registered",
AdditionalFields = "__RequestVerificationToken",
HttpMethod = "post",
PageHandler = "CheckEmail"
)]
public string? Email { get; set; }
Once you put this construction in a Input class, everything stops working.
[BindProperty]
public InputModel Input { get; set; }
public class InputModel
{
[Required]
[EmailAddress]
[Display(Name = "Email")]
[PageRemote(
ErrorMessage = "This email is already registered",
AdditionalFields = "__RequestVerificationToken",
HttpMethod = "post",
PageHandler = "CheckEmail"
)]
public string? Email { get; set; }
}
What am I doing wrong?)