}
else
{
@Html.Label(prop.PropertyName, prop.GetDisplayName() + ":", new { @class = htmlClass })
}
@if (metadata.Attributes.Attributes.Any(o => o.GetType() == typeof(System.ComponentModel.ReadOnlyAttribute)))
{
@Html.Hidden(prop.PropertyName)
@Html.Display(prop.PropertyName, prop.DataTypeName ?? prop.TemplateHint)
}
else if (!string.IsNullOrEmpty(uihit) && !(uihit == "EmailAddress" || uihit == "PhoneNumber"))
{
@Html.Editor(prop.PropertyName, prop.DataTypeName ?? prop.TemplateHint, prop.AdditionalValues)
}
else
{
if (prop.ModelType == typeof(string))
{
if (prop.DataTypeName == System.ComponentModel.DataAnnotations.DataType.Password.ToString())
{
@Html.Password(prop.PropertyName, null, new { @class = inputClass })
}
else if (prop.DataTypeName == System.ComponentModel.DataAnnotations.DataType.MultilineText.ToString())
{
@Html.TextArea(prop.PropertyName, null, new { @class = inputClass })
}
else
{
@Html.TextBox(prop.PropertyName, null, new { @class = inputClass })
}
}
else if (prop.ModelType == typeof(bool))
{
@Html.CheckBox(prop.PropertyName) @prop.GetDisplayName()
}
else
{
@Html.TextBox(prop.PropertyName, null, new { @class = inputClass })
}
}
@Html.ValidationMessage(prop.PropertyName, new { @class = "text-danger" })
@{
if (metadata != null)
{
var attr = metadata.Attributes.Attributes.OfType().FirstOrDefault() as System.ComponentModel.DescriptionAttribute;
if (attr != null && attr.Description != null)
{
@attr.Description
}
}
}