title: What is the advantage of using Tag Helpers in ASP.NET Core MVC
body: <p>I just come across a good write up for a new ASP.NET Core feature called <a href="http://stephenwalther.com/archive/2015/02/24/top-10-changes-in-asp-net-5-and-mvc-6" rel="noreferrer">Tag helpers</a>. </p>
  
  <p>From there, I understood that one can replace the following code:</p>
  
  <pre><code>@model MyProject.Models.Product
  
  @using (Html.BeginForm())
  {
      &lt;div&gt;
          @Html.LabelFor(m =&gt; p.Name, "Name:")
          @Html.TextBoxFor(m =&gt; p.Name)
      &lt;/div&gt;
      &lt;input type="submit" value="Create" /&gt;
  }
  </code></pre>
  
  <p>with:</p>
  
  <pre><code>@model MyProject.Models.Product
  @addtaghelper "Microsoft.AspNet.Mvc.TagHelpers"
  
  &lt;form asp-controller="Products" asp-action="Create" method="post"&gt;
      &lt;div&gt;
          &lt;label asp-for="Name"&gt;Name:&lt;/label&gt;
          &lt;input asp-for="Name" /&gt;
      &lt;/div&gt;
  
      &lt;input type="submit" value="Save" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>There's some new syntax such as <code>asp-controller</code>, <code>asp-for</code>, etc.  But what does it do? And what's the advantage of this new approach?</p>