I am trying to display a watermark for my Html.Editorfor,
Here is my ViewModel
[Display(Prompt="This is a WaterMark")]
[DisplayFormat(DataFormatString = "{0:MM/dd/yyy}", ApplyFormatInEditMode = true)]
public DateTime Dob { get; set; }
Here is my look
@Html.EditorFor(model => model.Dob)
here is my EditorTemplate String.cshtml in \ Views \ Shared \ EditorTemplates \ String.cshtml
@Html.TextBox("",ViewData.TemplateInfo.FormattedModelValue, new { @class="text-box single-line", placeholder = ViewData.ModelMetadata.Watermark })
I tried this following this topic . But my watermark never appeared, but why?
Appreciate your help to solve this problem.
source
share