When working with HTML / CSS, adding placeholder text to a textbox is typically done like this:
<input type="text" class="input-class" placeholder="Please enter your email"/>
However, in my case, I am using the provided code for a login panel in Visual Studio MVC 4 located at:
/Views/Account/Login.cshtml
The following C# code is currently rendering the inputs:
@Html.TextBoxFor(m => m.Email, new { @class = "form-input" })
@Html.ValidationMessageFor(m => m.Email, "", new { @class = "text-danger" })
@Html.PasswordFor(m => m.Password, new { @class = "form-input" })
@Html.ValidationMessageFor(m => m.Password, "", new { @class = "text-danger" })
https://i.sstatic.net/myoch.png
I have been attempting to add placeholder text to this code in C#, but encountered an issue. This was my attempt:
@Html.TextBoxFor(m => m.Email, placeholder ="Email" new { @class = "form-input" })
Unfortunately, 'placeholder' was highlighted in red indicating that "The name 'placeholder' does not exist in the current context".