Add registration workflow
Update unobtrusive Validation
This commit is contained in:
@@ -1,25 +1,33 @@
|
||||
@model object
|
||||
@{
|
||||
Layout = "~/Views/Shared/EditorTemplates/_FieldLayout.cshtml";
|
||||
Layout = "_FieldLayout.cshtml";
|
||||
}
|
||||
@{
|
||||
var htmlAttributes = new RouteValueDictionary();
|
||||
|
||||
if (ViewData.ContainsKey("type"))
|
||||
{
|
||||
htmlAttributes.Add("type", ViewData["type"]);
|
||||
}
|
||||
|
||||
var controlClass = "form-control";
|
||||
|
||||
if (ViewBag.@class != null)
|
||||
{
|
||||
htmlAttributes.Add("class", "form-control " + ViewBag.@class);
|
||||
}
|
||||
else
|
||||
{
|
||||
htmlAttributes.Add("class", "form-control");
|
||||
}
|
||||
if (ViewBag.@type != null)
|
||||
{
|
||||
htmlAttributes.Add("type", ViewBag.@type);
|
||||
controlClass = string.Concat(controlClass, " ", ViewBag.@class);
|
||||
}
|
||||
|
||||
if (ViewBag.placeholder != null)
|
||||
{
|
||||
htmlAttributes.Add("placeholder", ViewBag.placeholder);
|
||||
}
|
||||
|
||||
if (ViewData.ModelState.ContainsKey(ViewData.TemplateInfo.HtmlFieldPrefix) &&
|
||||
ViewData.ModelState[ViewData.TemplateInfo.HtmlFieldPrefix].Errors.Any())
|
||||
{
|
||||
controlClass = string.Concat(controlClass, " ", "is-invalid");
|
||||
}
|
||||
htmlAttributes.Add("class", controlClass);
|
||||
}
|
||||
|
||||
@Html.TextBox("", ViewData.TemplateInfo.FormattedModelValue, htmlAttributes)
|
||||
Reference in New Issue
Block a user