Skip to content

Commit

Permalink
Add a textarea demo
Browse files Browse the repository at this point in the history
  • Loading branch information
haacked authored and dahlbyk committed Jun 21, 2023
1 parent 1394fe2 commit 2a561c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Pages/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
<span asp-validation-for="Control"></span>
</div>

<div class="form-field">
<label asp-for="TextArea"></label>
<textarea asp-for="TextArea"></textarea>
<span asp-validation-for="TextArea"></span>
</div>

<div class="form-field">
@foreach (var animal in Model.Animals)
{
Expand Down
4 changes: 4 additions & 0 deletions Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public class IndexModel : PageModel
[Required]
public string? Control { get; set; }

[BindProperty]
[Required]
public string? TextArea { get; set; }

[BindProperty]
[Required]
public List<string>? SelectedAnimals { get; set; }
Expand Down

0 comments on commit 2a561c9

Please sign in to comment.