title: Input placeholder from ViewModel metadata in ASP.NET Core 1.0
body: <p>Is it possible to set up the built-in <code>asp-for</code> tag helper to take the input placeholder from the <code>[Display(Prompt = "This is the placeholder")]</code> attribute in the view model.</p>
  
  <pre><code>[Display(Name="Name", Prompt = "This is the placeholder")]        
  public string Name { get; set; }
  </code></pre>
  
  <p>In MVC 5 I am able to achieve this by adding additional logic in my editor templates and checking the <code>ViewData.ModelMetadata.Watermark</code> property. For example:</p>
  
  <pre><code>@model string
  @{
      Dictionary&lt;string, object&gt; htmlAttributes = new Dictionary&lt;string, object&gt;();
      htmlAttributes.Add("class", "form-control");
      if (!string.IsNullOrWhiteSpace(ViewData.ModelMetadata.Watermark))
      {
          htmlAttributes.Add("placeholder", ViewData.ModelMetadata.Watermark);
      }
  }
  @Html.Label("")
  @Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
  @Html.ValidationMessage("", "", new { @class = "text-danger" })
  </code></pre>
  
  <p>But now in ASP.NET Core 1.0 I would like to start using the new tag helpers approach. By default, the build in <code>asp-for</code> helper simply ignores the <code>Prompt</code> attribute value.</p>
  
  <p>Having my own custom implementation of the <code>asp-for</code> attribute, e.g. <code>my-asp-for</code> is an option and most probably I will end up having it for the sake of maintainability and reusing additional logic. 
  But then the <code>Watermark</code> property is no longer present in the <code>ModelMetadata</code>, i.e. there is no such thing as <code>For.Metadata.Watermark</code>.</p>
  
  <p>The only place I can see the <code>Prompt</code> value in the <code>asp-for</code> helper is somewhat hidden.</p>
  
  <p><a href="https://i.stack.imgur.com/U1JdG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U1JdG.png" alt="enter image description here"></a></p>
  
  <p>So I have two questions. 
  Is there a smarter way to do that ? 
  Is it a bad practice to take the placeholder from the viewmodel metadata, i.e. I should explicitly specify it it in the razor file ?</p>