Can somebody tell me why "This field is required" and "Please insert database name" are being displayed instead of just "Please insert database name"?
This is my model :
public class InstallViewModel
{
[Required(AllowEmptyStrings = false, ErrorMessage = "Please insert database name")]
public string DatabaseName { get; set; }
and this is my view :
<div class="input-group">
<span class="input-group-addon">Database</span>
@Html.TextBoxFor(w => w.DatabaseName, new { @class = "form-control", placeholder = "Database name" })
</div>
@Html.ValidationMessageFor(w=> w.DatabaseName)
Thank you.
EDIT:
Can you see the image attached ? I have some problems uploading images.
The view is a partial view and this is the whole partial view:
@Html.ValidationMessageFor(w => w.DatabaseName)
<div class="input-group">
<span class="input-group-addon">Database</span>
@Html.TextBoxFor(w => w.DatabaseName, new { @class = "form-control", placeholder = "Database name" })
</div>
<br />
@Html.CheckBoxFor(w => w.UseWindowsAuthentication, new { @checked = "checked" }) Use Windows Authentication<br /><br />
<div class="wizard-sqlauth" style="display: none">
<div class="input-group">
<span class="input-group-addon">User name</span>
@Html.TextBoxFor(w => w.UserName, new { @class = "form-control", placeholder = "User name" })
</div>
@Html.ValidationMessageFor(w => w.UserName)<br />
<div class="input-group">
<span class="input-group-addon">Password</span>
@Html.PasswordFor(w => w.Password, new { @class = "form-control" })
</div>
@Html.ValidationMessageFor(w => w.Password)
</div>