90 references to ModelState
Identity.DefaultUI.WebSite (1)
Pages\Contoso\Login.cshtml.cs (1)
48if (!ModelState.IsValid)
Identity.ExternalClaims (22)
Pages\Account\ExternalLogin.cshtml.cs (2)
111if (ModelState.IsValid) 140ModelState.AddModelError(string.Empty, error.Description);
Pages\Account\ForgotPassword.cshtml.cs (1)
39if (ModelState.IsValid)
Pages\Account\Login.cshtml.cs (3)
57ModelState.AddModelError(string.Empty, ErrorMessage); 72if (ModelState.IsValid) 93ModelState.AddModelError(string.Empty, "Invalid login attempt.");
Pages\Account\LoginWith2fa.cshtml.cs (2)
65if (!ModelState.IsValid) 93ModelState.AddModelError(string.Empty, "Invalid authenticator code.");
Pages\Account\LoginWithRecoveryCode.cshtml.cs (2)
58if (!ModelState.IsValid) 86ModelState.AddModelError(string.Empty, "Invalid recovery code entered.");
Pages\Account\Manage\ChangePassword.cshtml.cs (2)
77if (!ModelState.IsValid) 93ModelState.AddModelError(string.Empty, error.Description);
Pages\Account\Manage\EnableAuthenticator.cshtml.cs (2)
81if (!ModelState.IsValid) 95ModelState.AddModelError("Input.Code", "Verification code is invalid.");
Pages\Account\Manage\Index.cshtml.cs (2)
78if (!ModelState.IsValid) 112if (!ModelState.IsValid)
Pages\Account\Manage\SetPassword.cshtml.cs (2)
69if (!ModelState.IsValid) 85ModelState.AddModelError(string.Empty, error.Description);
Pages\Account\Register.cshtml.cs (2)
69if (ModelState.IsValid) 86ModelState.AddModelError(string.Empty, error.Description);
Pages\Account\ResetPassword.cshtml.cs (2)
65if (!ModelState.IsValid) 85ModelState.AddModelError(string.Empty, error.Description);
IdentitySample.DefaultUI (3)
Areas\Identity\Pages\Account\Manage\Index.cshtml.cs (1)
71if (!ModelState.IsValid)
Areas\Identity\Pages\Account\Register.cshtml.cs (2)
80if (ModelState.IsValid) 116ModelState.AddModelError(string.Empty, error.Description);
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)
RazorPagesWebSite (3)
Pages\CustomModelTypeModel.cshtml.cs (1)
76if (!ModelState.IsValid)
Pages\PropertyBinding\PolymorphicBinding.cs (2)
16if (!ModelState.IsValid) 18return BadRequest(ModelState);