8452a9cce0
Update unobtrusive Validation
30 lines
693 B
Plaintext
30 lines
693 B
Plaintext
@using LeafWeb.WebCms.Utility
|
|
@model object
|
|
@{
|
|
Layout = "_FieldLayout.cshtml";
|
|
}
|
|
@{
|
|
var htmlAttributes = new RouteValueDictionary();
|
|
|
|
htmlAttributes.Add("type", "email");
|
|
|
|
var controlClass = "form-control";
|
|
|
|
if (ViewBag.@class != null)
|
|
{
|
|
controlClass = string.Concat(controlClass, " ", ViewBag.@class);
|
|
}
|
|
|
|
if (ViewBag.placeholder != null)
|
|
{
|
|
htmlAttributes.Add("placeholder", ViewBag.placeholder);
|
|
}
|
|
|
|
if (Html.HasError())
|
|
{
|
|
controlClass = string.Concat(controlClass, " ", "is-invalid");
|
|
}
|
|
htmlAttributes.Add("class", controlClass);
|
|
}
|
|
|
|
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes) |