Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Demo RemoteAttribute.AdditionalFields in Validation sample. (#14932)
- Loading branch information
1 parent
cc24622
commit 74de68c
Showing
3 changed files
with
47 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
aspnetcore/mvc/models/validation/sample/Views/Users/CheckName.cshtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@model User | ||
@{ | ||
ViewData["Title"] = "Check Name"; | ||
} | ||
|
||
<h2>Check Name</h2> | ||
<form asp-action="CheckName"> | ||
<div class="form-horizontal"> | ||
<h4>User Name</h4> | ||
<hr /> | ||
<div asp-validation-summary="ModelOnly" class="text-danger"></div> | ||
<div class="form-group"> | ||
<ol> | ||
<li>Enter a first name and last name. Validate accepts the name.</li> | ||
<li>Enter a different first name and last name. Validate accepts the name.</li> | ||
<li>Re-enter the first name and last name from the first step. Validation fails.</li> | ||
</ol> | ||
<label asp-for="FirstName" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="FirstName" class="form-control" /> | ||
<span asp-validation-for="FirstName" class="text-danger"></span> | ||
</div> | ||
<label asp-for="LastName" class="col-md-2 control-label"></label> | ||
<div class="col-md-10"> | ||
<input asp-for="LastName" class="form-control" /> | ||
<span asp-validation-for="LastName" class="text-danger"></span> | ||
</div> | ||
</div> | ||
<div class="form-group"> | ||
<div class="col-md-offset-2 col-md-10"> | ||
<input type="button" value="Validate" class="btn btn-default" /> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
@section Scripts { | ||
@{await Html.RenderPartialAsync("_ValidationScriptsPartial");} | ||
} |