90 references to ModelState
Identity.DefaultUI.WebSite (1)
Pages\Contoso\Login.cshtml.cs (1)
48
if (!
ModelState
.IsValid)
Identity.ExternalClaims (22)
Pages\Account\ExternalLogin.cshtml.cs (2)
111
if (
ModelState
.IsValid)
140
ModelState
.AddModelError(string.Empty, error.Description);
Pages\Account\ForgotPassword.cshtml.cs (1)
39
if (
ModelState
.IsValid)
Pages\Account\Login.cshtml.cs (3)
57
ModelState
.AddModelError(string.Empty, ErrorMessage);
72
if (
ModelState
.IsValid)
93
ModelState
.AddModelError(string.Empty, "Invalid login attempt.");
Pages\Account\LoginWith2fa.cshtml.cs (2)
65
if (!
ModelState
.IsValid)
93
ModelState
.AddModelError(string.Empty, "Invalid authenticator code.");
Pages\Account\LoginWithRecoveryCode.cshtml.cs (2)
58
if (!
ModelState
.IsValid)
86
ModelState
.AddModelError(string.Empty, "Invalid recovery code entered.");
Pages\Account\Manage\ChangePassword.cshtml.cs (2)
77
if (!
ModelState
.IsValid)
93
ModelState
.AddModelError(string.Empty, error.Description);
Pages\Account\Manage\EnableAuthenticator.cshtml.cs (2)
81
if (!
ModelState
.IsValid)
95
ModelState
.AddModelError("Input.Code", "Verification code is invalid.");
Pages\Account\Manage\Index.cshtml.cs (2)
78
if (!
ModelState
.IsValid)
112
if (!
ModelState
.IsValid)
Pages\Account\Manage\SetPassword.cshtml.cs (2)
69
if (!
ModelState
.IsValid)
85
ModelState
.AddModelError(string.Empty, error.Description);
Pages\Account\Register.cshtml.cs (2)
69
if (
ModelState
.IsValid)
86
ModelState
.AddModelError(string.Empty, error.Description);
Pages\Account\ResetPassword.cshtml.cs (2)
65
if (!
ModelState
.IsValid)
85
ModelState
.AddModelError(string.Empty, error.Description);
IdentitySample.DefaultUI (3)
Areas\Identity\Pages\Account\Manage\Index.cshtml.cs (1)
71
if (!
ModelState
.IsValid)
Areas\Identity\Pages\Account\Register.cshtml.cs (2)
80
if (
ModelState
.IsValid)
116
ModelState
.AddModelError(string.Empty, error.Description);
Microsoft.AspNetCore.Identity.UI (54)
Areas\Identity\Pages\V4\Account\ExternalLogin.cshtml.cs (2)
181
if (
ModelState
.IsValid)
222
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\ForgotPassword.cshtml.cs (1)
64
if (
ModelState
.IsValid)
Areas\Identity\Pages\V4\Account\Login.cshtml.cs (3)
107
ModelState
.AddModelError(string.Empty, ErrorMessage);
126
if (
ModelState
.IsValid)
147
ModelState
.AddModelError(string.Empty, "Invalid login attempt.");
Areas\Identity\Pages\V4\Account\LoginWith2fa.cshtml.cs (2)
111
if (!
ModelState
.IsValid)
143
ModelState
.AddModelError(string.Empty, "Invalid authenticator code.");
Areas\Identity\Pages\V4\Account\LoginWithRecoveryCode.cshtml.cs (2)
96
if (!
ModelState
.IsValid)
126
ModelState
.AddModelError(string.Empty, "Invalid recovery code entered.");
Areas\Identity\Pages\V4\Account\Manage\ChangePassword.cshtml.cs (2)
115
if (!
ModelState
.IsValid)
131
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\Manage\DeletePersonalData.cshtml.cs (1)
100
ModelState
.AddModelError(string.Empty, "Incorrect password.");
Areas\Identity\Pages\V4\Account\Manage\Email.cshtml.cs (2)
130
if (!
ModelState
.IsValid)
165
if (!
ModelState
.IsValid)
Areas\Identity\Pages\V4\Account\Manage\EnableAuthenticator.cshtml.cs (2)
124
if (!
ModelState
.IsValid)
138
ModelState
.AddModelError("Input.Code", "Verification code is invalid.");
Areas\Identity\Pages\V4\Account\Manage\Index.cshtml.cs (1)
111
if (!
ModelState
.IsValid)
Areas\Identity\Pages\V4\Account\Manage\SetPassword.cshtml.cs (2)
103
if (!
ModelState
.IsValid)
119
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\Register.cshtml.cs (2)
127
if (
ModelState
.IsValid)
162
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V4\Account\ResendEmailConfirmation.cshtml.cs (3)
74
if (!
ModelState
.IsValid)
82
ModelState
.AddModelError(string.Empty, "Verification email sent. Please check your email.");
96
ModelState
.AddModelError(string.Empty, "Verification email sent. Please check your email.");
Areas\Identity\Pages\V4\Account\ResetPassword.cshtml.cs (2)
108
if (!
ModelState
.IsValid)
128
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\ExternalLogin.cshtml.cs (2)
181
if (
ModelState
.IsValid)
222
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\ForgotPassword.cshtml.cs (1)
64
if (
ModelState
.IsValid)
Areas\Identity\Pages\V5\Account\Login.cshtml.cs (3)
107
ModelState
.AddModelError(string.Empty, ErrorMessage);
126
if (
ModelState
.IsValid)
147
ModelState
.AddModelError(string.Empty, "Invalid login attempt.");
Areas\Identity\Pages\V5\Account\LoginWith2fa.cshtml.cs (2)
111
if (!
ModelState
.IsValid)
143
ModelState
.AddModelError(string.Empty, "Invalid authenticator code.");
Areas\Identity\Pages\V5\Account\LoginWithRecoveryCode.cshtml.cs (2)
96
if (!
ModelState
.IsValid)
126
ModelState
.AddModelError(string.Empty, "Invalid recovery code entered.");
Areas\Identity\Pages\V5\Account\Manage\ChangePassword.cshtml.cs (2)
115
if (!
ModelState
.IsValid)
131
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\Manage\DeletePersonalData.cshtml.cs (1)
100
ModelState
.AddModelError(string.Empty, "Incorrect password.");
Areas\Identity\Pages\V5\Account\Manage\Email.cshtml.cs (2)
130
if (!
ModelState
.IsValid)
165
if (!
ModelState
.IsValid)
Areas\Identity\Pages\V5\Account\Manage\EnableAuthenticator.cshtml.cs (2)
124
if (!
ModelState
.IsValid)
138
ModelState
.AddModelError("Input.Code", "Verification code is invalid.");
Areas\Identity\Pages\V5\Account\Manage\Index.cshtml.cs (1)
111
if (!
ModelState
.IsValid)
Areas\Identity\Pages\V5\Account\Manage\SetPassword.cshtml.cs (2)
103
if (!
ModelState
.IsValid)
119
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\Register.cshtml.cs (2)
127
if (
ModelState
.IsValid)
162
ModelState
.AddModelError(string.Empty, error.Description);
Areas\Identity\Pages\V5\Account\ResendEmailConfirmation.cshtml.cs (3)
74
if (!
ModelState
.IsValid)
82
ModelState
.AddModelError(string.Empty, "Verification email sent. Please check your email.");
96
ModelState
.AddModelError(string.Empty, "Verification email sent. Please check your email.");
Areas\Identity\Pages\V5\Account\ResetPassword.cshtml.cs (2)
108
if (!
ModelState
.IsValid)
128
ModelState
.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>
1658
return
ModelState
.IsValid;
Microsoft.AspNetCore.Mvc.RazorPages.Test (2)
PageModelTest.cs (2)
1747
Assert.Same(modelState, pageModel.
ModelState
);
1774
var modelState = Assert.Single(pageModel.
ModelState
);
Mvc.Api.Analyzers.Test (1)
TestFiles\ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzerIntegrationTest\NoDiagnosticsAreReturned_ForRazorPageModels.cs (1)
12
if (!
ModelState
.IsValid)
RazorPagesWebSite (3)
Pages\CustomModelTypeModel.cshtml.cs (1)
76
if (!
ModelState
.IsValid)
Pages\PropertyBinding\PolymorphicBinding.cs (2)
16
if (!
ModelState
.IsValid)
18
return BadRequest(
ModelState
);