Skip to content

Commit 20dd338

Browse files
njpranavkm
authored andcommitted
Use ModelOnly for Validation Summary (#6108)
Previously when Validation Summary used "All", it would append the property-related content to both the summary as well as the property specific span elements (= asp-validation-for="..."). By switching to ModelOnly would only show model-related messages in the summary (such as "Invalid login attempt.") which was most likely the original intention.
1 parent f002922 commit 20dd338

37 files changed

+37
-37
lines changed

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ExternalLogin.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="row">
1818
<div class="col-md-4">
1919
<form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post">
20-
<div asp-validation-summary="All" class="text-danger"></div>
20+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
2121
<div class="form-group">
2222
<label asp-for="Input.Email"></label>
2323
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ForgotPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-4">
1212
<form method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Input.Email"></label>
1616
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Login.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<form id="account" method="post">
1313
<h4>Use a local account to log in.</h4>
1414
<hr />
15-
<div asp-validation-summary="All" class="text-danger"></div>
15+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1616
<div class="form-group">
1717
<label asp-for="Input.Email"></label>
1818
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/LoginWith2fa.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="col-md-4">
1212
<form method="post" asp-route-returnUrl="@Model.ReturnUrl">
1313
<input asp-for="RememberMe" type="hidden" />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="Input.TwoFactorCode"></label>
1717
<input asp-for="Input.TwoFactorCode" class="form-control" autocomplete="off" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/LoginWithRecoveryCode.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="row">
1414
<div class="col-md-4">
1515
<form method="post">
16-
<div asp-validation-summary="All" class="text-danger"></div>
16+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1717
<div class="form-group">
1818
<label asp-for="Input.RecoveryCode"></label>
1919
<input asp-for="Input.RecoveryCode" class="form-control" autocomplete="off" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/ChangePassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-6">
1212
<form id="change-password-form" method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Input.OldPassword"></label>
1616
<input asp-for="Input.OldPassword" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/DeletePersonalData.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
<div>
1818
<form id="delete-user" method="post" class="form-group">
19-
<div asp-validation-summary="All" class="text-danger"></div>
19+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
2020
@if (Model.RequirePassword)
2121
{
2222
<div class="form-group">

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-6">
1212
<form id="profile-form" method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Username"></label>
1616
<input asp-for="Username" class="form-control" disabled />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Manage/SetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="row">
1515
<div class="col-md-6">
1616
<form id="set-password-form" method="post">
17-
<div asp-validation-summary="All" class="text-danger"></div>
17+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1818
<div class="form-group">
1919
<label asp-for="Input.NewPassword"></label>
2020
<input asp-for="Input.NewPassword" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/Register.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post">
1212
<h4>Create a new account.</h4>
1313
<hr />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="Input.Email"></label>
1717
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V3/Account/ResetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-4">
1212
<form method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<input asp-for="Input.Code" type="hidden" />
1515
<div class="form-group">
1616
<label asp-for="Input.Email"></label>

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ExternalLogin.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="row">
1818
<div class="col-md-4">
1919
<form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post">
20-
<div asp-validation-summary="All" class="text-danger"></div>
20+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
2121
<div class="form-group">
2222
<label asp-for="Input.Email"></label>
2323
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ForgotPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-4">
1212
<form method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Input.Email"></label>
1616
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Login.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<form id="account" method="post">
1313
<h4>Use a local account to log in.</h4>
1414
<hr />
15-
<div asp-validation-summary="All" class="text-danger"></div>
15+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1616
<div class="form-group">
1717
<label asp-for="Input.Email"></label>
1818
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/LoginWith2fa.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="col-md-4">
1212
<form method="post" asp-route-returnUrl="@Model.ReturnUrl">
1313
<input asp-for="RememberMe" type="hidden" />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="Input.TwoFactorCode"></label>
1717
<input asp-for="Input.TwoFactorCode" class="form-control" autocomplete="off" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/LoginWithRecoveryCode.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<div class="row">
1414
<div class="col-md-4">
1515
<form method="post">
16-
<div asp-validation-summary="All" class="text-danger"></div>
16+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1717
<div class="form-group">
1818
<label asp-for="Input.RecoveryCode"></label>
1919
<input asp-for="Input.RecoveryCode" class="form-control" autocomplete="off" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/ChangePassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-6">
1212
<form id="change-password-form" method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Input.OldPassword"></label>
1616
<input asp-for="Input.OldPassword" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/DeletePersonalData.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<div>
1717
<form id="delete-user" method="post" class="form-group">
18-
<div asp-validation-summary="All" class="text-danger"></div>
18+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1919
@if (Model.RequirePassword)
2020
{
2121
<div class="form-group">

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-6">
1212
<form id="profile-form" method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Username"></label>
1616
<input asp-for="Username" class="form-control" disabled />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Manage/SetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<div class="row">
1515
<div class="col-md-6">
1616
<form id="set-password-form" method="post">
17-
<div asp-validation-summary="All" class="text-danger"></div>
17+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1818
<div class="form-group">
1919
<label asp-for="Input.NewPassword"></label>
2020
<input asp-for="Input.NewPassword" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/Register.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<form id="registerForm" asp-route-returnUrl="@Model.ReturnUrl" method="post">
1212
<h4>Create a new account.</h4>
1313
<hr />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="Input.Email"></label>
1717
<input asp-for="Input.Email" class="form-control" />

src/Identity/UI/src/Areas/Identity/Pages/V4/Account/ResetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="row">
1111
<div class="col-md-4">
1212
<form method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<input asp-for="Input.Code" type="hidden" />
1515
<div class="form-group">
1616
<label asp-for="Input.Email"></label>

src/Identity/samples/IdentitySample.DefaultUI/Areas/Identity/Pages/Account/Manage/Index.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="row">
1010
<div class="col-md-6">
1111
<form method="post">
12-
<div asp-validation-summary="All" class="text-danger"></div>
12+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1313
<div class="form-group">
1414
<label asp-for="Username"></label>
1515
<input asp-for="Username" class="form-control" disabled />

src/Identity/samples/IdentitySample.DefaultUI/Areas/Identity/Pages/Account/Register.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<form asp-route-returnUrl="@Model.ReturnUrl" method="post">
1212
<h4>Create a new account.</h4>
1313
<hr />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="Input.Email"></label>
1717
<input asp-for="Input.Email" class="form-control" />

src/Identity/samples/IdentitySample.Mvc/Views/Account/ExternalLoginConfirmation.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<form asp-controller="Account" asp-action="ExternalLoginConfirmation" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
1010
<h4>Association Form</h4>
1111
<hr />
12-
<div asp-validation-summary="All" class="text-danger"></div>
12+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1313

1414
<p class="text-info">
1515
You've successfully authenticated with <strong>@ViewData["ProviderDisplayName"]</strong>.

src/Identity/samples/IdentitySample.Mvc/Views/Account/ForgotPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@*<form asp-controller="Account" asp-action="ForgotPassword" method="post" class="form-horizontal" role="form">
1212
<h4>Enter your email.</h4>
1313
<hr />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="Email" class="col-md-2 control-label"></label>
1717
<div class="col-md-10">

src/Identity/samples/IdentitySample.Mvc/Views/Account/Login.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<form asp-controller="Account" asp-action="Login" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
1616
<h4>Use a local account to log in.</h4>
1717
<hr />
18-
<div asp-validation-summary="All" class="text-danger"></div>
18+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1919
<div class="form-group">
2020
<label asp-for="Email" class="col-md-2 control-label"></label>
2121
<div class="col-md-10">

src/Identity/samples/IdentitySample.Mvc/Views/Account/Register.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<form asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
99
<h4>Create a new account.</h4>
1010
<hr />
11-
<div asp-validation-summary="All" class="text-danger"></div>
11+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1212
<div class="form-group">
1313
<label asp-for="Email" class="col-md-2 control-label"></label>
1414
<div class="col-md-10">

src/Identity/samples/IdentitySample.Mvc/Views/Account/ResetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<form asp-controller="Account" asp-action="ResetPassword" method="post" class="form-horizontal" role="form">
99
<h4>Reset your password.</h4>
1010
<hr />
11-
<div asp-validation-summary="All" class="text-danger"></div>
11+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1212
<input asp-for="Code" type="hidden" />
1313
<div class="form-group">
1414
<label asp-for="Email" class="col-md-2 control-label"></label>

src/Identity/samples/IdentitySample.Mvc/Views/Account/UseRecoveryCode.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h1>@ViewData["Title"].</h1>
77

88
<form asp-controller="Account" asp-action="UseRecoveryCode" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
9-
<div asp-validation-summary="All" class="text-danger"></div>
9+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1010
<h4>@ViewData["Status"]</h4>
1111
<hr />
1212
<div class="form-group">

src/Identity/samples/IdentitySample.Mvc/Views/Account/VerifyAuthenticatorCode.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h1>@ViewData["Title"].</h1>
77

88
<form asp-controller="Account" asp-action="VerifyAuthenticatorCode" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
9-
<div asp-validation-summary="All" class="text-danger"></div>
9+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1010
<input asp-for="RememberMe" type="hidden" />
1111
<h4>@ViewData["Status"]</h4>
1212
<hr />

src/Identity/samples/IdentitySample.Mvc/Views/Account/VerifyCode.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h1>@ViewData["Title"].</h1>
77

88
<form asp-controller="Account" asp-action="VerifyCode" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
9-
<div asp-validation-summary="All" class="text-danger"></div>
9+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1010
<input asp-for="Provider" type="hidden" />
1111
<input asp-for="RememberMe" type="hidden" />
1212
<h4>@ViewData["Status"]</h4>

src/Identity/samples/IdentitySample.Mvc/Views/Manage/AddPhoneNumber.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<form asp-controller="Manage" asp-action="AddPhoneNumber" method="post" class="form-horizontal" role="form">
88
<h4>Add a phone number.</h4>
99
<hr />
10-
<div asp-validation-summary="All" class="text-danger"></div>
10+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1111
<div class="form-group">
1212
<label asp-for="PhoneNumber" class="col-md-2 control-label"></label>
1313
<div class="col-md-10">

src/Identity/samples/IdentitySample.Mvc/Views/Manage/ChangePassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<form asp-controller="Manage" asp-action="ChangePassword" method="post" class="form-horizontal" role="form">
99
<h4>Change Password Form</h4>
1010
<hr />
11-
<div asp-validation-summary="All" class="text-danger"></div>
11+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1212
<div class="form-group">
1313
<label asp-for="OldPassword" class="col-md-2 control-label"></label>
1414
<div class="col-md-10">

src/Identity/samples/IdentitySample.Mvc/Views/Manage/SetPassword.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<form asp-controller="Manage" asp-action="SetPassword" asp-route-returnurl="@ViewData["ReturnUrl"]" method="post" class="form-horizontal" role="form">
1212
<h4>Set your password</h4>
1313
<hr />
14-
<div asp-validation-summary="All" class="text-danger"></div>
14+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1515
<div class="form-group">
1616
<label asp-for="NewPassword" class="col-md-2 control-label"></label>
1717
<div class="col-md-10">

src/Identity/samples/IdentitySample.Mvc/Views/Manage/VerifyPhoneNumber.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<h4>Add a phone number.</h4>
1111
<h5>@ViewData["Status"]</h5>
1212
<hr />
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Code" class="col-md-2 control-label"></label>
1616
<div class="col-md-10">

src/Identity/testassets/Identity.DefaultUI.WebSite/Pages/Contoso/Login.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<div class="col-md-4">
1111
<section>
1212
<form id="external-login" method="post">
13-
<div asp-validation-summary="All" class="text-danger"></div>
13+
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
1414
<div class="form-group">
1515
<label asp-for="Input.Login"></label>
1616
<input asp-for="Input.Login" class="form-control" />

0 commit comments

Comments
 (0)