I have a model:
[DataType(DataType.EmailAddress)]
[DisplayFormat(ConvertEmptyStringToNull = true)]
[Display(Prompt = "Email Address")]
public string Email { get; set; }
I am trying to get the "prompt" to show in the placeholder text of the resulting text box with the following:
@Html.EditorFor(model => model.Email,
new { htmlAttributes = new { @class = "form-control input-md",
placeholder = @ViewData.ModelMetadata.Watermark } })
When I view the generated HTML I only get "placeholder" in the input tag. According to what I have read ViewData.ModelMetadata.Watermark should work. What is the correct way to get this placeholder text in place?