Tuesday, 22 March 2022

Form Tag Helpers

 # form tag Helpers

1. We use the following common tag helpers to create a form in ASP.NET Core

    Form Tag Helper
    Label Tag Helper
    Input Tag Helper
    Select Tag Helper
    Textarea Tag Helper
    Validation tag helpers.
    
2. <form asp-controller="home" asp-action="create" method="post">
</form>
is equal to
<form method="post" action="/home/create"></form>

3. <input asp-for="Name"> is same as
<input type="text" id="Name" name="Name" value="">

4. Label Tag Helper

<label asp-for="Name"></label>
<input asp-for="Name">

generates

<label for="Name">Name</label>
<input type="text" id="Name" name="Name" value="">

5. Select Tag Helper
 <select asp-for="Department"
        asp-items="Html.GetEnumSelectList<Dept>()"></select>
same as
 <select id="Department" name="Department">
    <option value="0">None</option>
    <option value="1">HR</option>
    <option value="2">Payroll</option>
    <option value="3">IT</option>
</select>

6.


No comments:

Post a Comment

Search This Blog

Creating your first "Alexa" Skill

Index What is Alexa What is Alexa Skill? Why is it required when Alexa already equipped with voice assistant? Dev...