61 references to ModelState
Microsoft.AspNetCore.Identity.UI (54)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (2)
181if (ModelState.IsValid) 222ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\ForgotPassword.cshtml.cs (1)
64if (ModelState.IsValid)
Areas\Identity\Pages\V4\Account\Login.cshtml.cs (3)
107ModelState.AddModelError(string.Empty, ErrorMessage); 126if (ModelState.IsValid) 147ModelState.AddModelError(string.Empty, "Invalid login attempt.");
Areas\Identity\Pages\V4\Account\LoginWith2fa.cshtml.cs (2)
111if (!ModelState.IsValid) 143ModelState.AddModelError(string.Empty, "Invalid authenticator code.");
Areas\Identity\Pages\V4\Account\LoginWithRecoveryCode.cshtml.cs (2)
96if (!ModelState.IsValid) 126ModelState.AddModelError(string.Empty, "Invalid recovery code entered.");
Areas\Identity\Pages\V4\Account\Manage\ChangePassword.cshtml.cs (2)
115if (!ModelState.IsValid) 131ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\Manage\DeletePersonalData.cshtml.cs (1)
100ModelState.AddModelError(string.Empty, "Incorrect password.");
Areas\Identity\Pages\V4\Account\Manage\Email.cshtml.cs (2)
130if (!ModelState.IsValid) 165if (!ModelState.IsValid)
Areas\Identity\Pages\V4\Account\Manage\EnableAuthenticator.cshtml.cs (2)
124if (!ModelState.IsValid) 138ModelState.AddModelError("Input.Code", "Verification code is invalid.");
Areas\Identity\Pages\V4\Account\Manage\Index.cshtml.cs (1)
111if (!ModelState.IsValid)
Areas\Identity\Pages\V4\Account\Manage\SetPassword.cshtml.cs (2)
103if (!ModelState.IsValid) 119ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (2)
127if (ModelState.IsValid) 162ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\ResendEmailConfirmation.cshtml.cs (3)
74if (!ModelState.IsValid) 82ModelState.AddModelError(string.Empty, "Verification email sent. Please check your email."); 96ModelState.AddModelError(string.Empty, "Verification email sent. Please check your email.");
Areas\Identity\Pages\V4\Account\ResetPassword.cshtml.cs (2)
108if (!ModelState.IsValid) 128ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (2)
181if (ModelState.IsValid) 222ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\ForgotPassword.cshtml.cs (1)
64if (ModelState.IsValid)
Areas\Identity\Pages\V5\Account\Login.cshtml.cs (3)
107ModelState.AddModelError(string.Empty, ErrorMessage); 126if (ModelState.IsValid) 147ModelState.AddModelError(string.Empty, "Invalid login attempt.");
Areas\Identity\Pages\V5\Account\LoginWith2fa.cshtml.cs (2)
111if (!ModelState.IsValid) 143ModelState.AddModelError(string.Empty, "Invalid authenticator code.");
Areas\Identity\Pages\V5\Account\LoginWithRecoveryCode.cshtml.cs (2)
96if (!ModelState.IsValid) 126ModelState.AddModelError(string.Empty, "Invalid recovery code entered.");
Areas\Identity\Pages\V5\Account\Manage\ChangePassword.cshtml.cs (2)
115if (!ModelState.IsValid) 131ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\Manage\DeletePersonalData.cshtml.cs (1)
100ModelState.AddModelError(string.Empty, "Incorrect password.");
Areas\Identity\Pages\V5\Account\Manage\Email.cshtml.cs (2)
130if (!ModelState.IsValid) 165if (!ModelState.IsValid)
Areas\Identity\Pages\V5\Account\Manage\EnableAuthenticator.cshtml.cs (2)
124if (!ModelState.IsValid) 138ModelState.AddModelError("Input.Code", "Verification code is invalid.");
Areas\Identity\Pages\V5\Account\Manage\Index.cshtml.cs (1)
111if (!ModelState.IsValid)
Areas\Identity\Pages\V5\Account\Manage\SetPassword.cshtml.cs (2)
103if (!ModelState.IsValid) 119ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (2)
127if (ModelState.IsValid) 162ModelState.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\ResendEmailConfirmation.cshtml.cs (3)
74if (!ModelState.IsValid) 82ModelState.AddModelError(string.Empty, "Verification email sent. Please check your email."); 96ModelState.AddModelError(string.Empty, "Verification email sent. Please check your email.");
Areas\Identity\Pages\V5\Account\ResetPassword.cshtml.cs (2)
108if (!ModelState.IsValid) 128ModelState.AddModelError(string.Empty, error.Description);
Microsoft.AspNetCore.Mvc.RazorPages (4)
PageModel.cs (4)
1631/// <returns><c>true</c> if the <see cref="ModelState"/> is valid; <c>false</c> otherwise.</returns> 1644/// <param name="name">The key to use when looking up information in <see cref="ModelState"/>. 1646/// <returns><c>true</c> if the <see cref="ModelState"/> is valid;<c>false</c> otherwise.</returns> 1658return ModelState.IsValid;
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
PageModelTest.cs (2)
1747Assert.Same(modelState, pageModel.ModelState); 1774var modelState = Assert.Single(pageModel.ModelState);
Mvc.Api.Analyzers.Test (1)
TestFiles\ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForRazorPageModels.cs (1)
12if (!ModelState.IsValid)