You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I downloaded the ExpressiveAnnotations and tried to implement it in my project. Having trouble getting it to work. The validation message didn't appear. Thank you for your help.
@Html.DropDownListFor(m => m.Search_Profile_Type, new List
{
new SelectListItem{ Text="ALL", Value = "ALL" },
new SelectListItem{ Text="Adjuster (Person)", Value = "ADJUSTER" },
new SelectListItem{ Text="Attorney (Person)", Value = "ATTORNEY" },
new SelectListItem{ Text="Carrier, Self-Insured Employer, Fund (Company)", Value = "CARRIER" },
new SelectListItem{ Text="Employer Contact Person (Person)", Value = "EMP_CONT" },
new SelectListItem{ Text="Employer (Company)", Value = "EMPLOYER" },
new SelectListItem{ Text="Injured Employee (Person)", Value = "IE" },
new SelectListItem{ Text="Other Contact Person (Person)", Value = "OTHERCONT" },
new SelectListItem{ Text="Other Company (Company)", Value = "OTHERCOMP" },
new SelectListItem{ Text="Rehab Provider Company (Company)", Value = "REHABCO" },
new SelectListItem{ Text="Rehab Provider Contact Person (Person)", Value = "RHC_CONT" },
new SelectListItem{ Text="Rehab Provider (Person)", Value = "QRP" },
new SelectListItem{ Text="Third Party Administrator (Company)", Value = "TPA" },
new SelectListItem{ Text="Vendor (School, Bookstore, Training Facility, etc.) (Company)", Value = "VENDOR" },
new SelectListItem{ Text="Vendor Contact Person (Person)", Value = "VEND_CONT" }}, new { @Class = "form-control", @Style = "max-width:400px;height:35px;resize:horizontal" })
@Html.LabelFor(m => m.Search_Company, htmlAttributes: new { @Class = "control-label col-md-2", id = "Search_Company_Label" })
Hello,
I downloaded the ExpressiveAnnotations and tried to implement it in my project. Having trouble getting it to work. The validation message didn't appear. Thank you for your help.
Here is what I got:
[DisplayName("Company Name")]
[RequiredIf("Search_Profile_Type == 'EMPLOYER'")]
public string Search_Company { get; set; }
@Html.ValidationSummary(true, "", new { @Class = "text-danger" })
@Html.LabelFor(m => m.Search_Profile_Type, htmlAttributes: new { @Class = "control-label col-md-2" })
@Html.DropDownListFor(m => m.Search_Profile_Type, new List
{
new SelectListItem{ Text="ALL", Value = "ALL" },
new SelectListItem{ Text="Adjuster (Person)", Value = "ADJUSTER" },
new SelectListItem{ Text="Attorney (Person)", Value = "ATTORNEY" },
new SelectListItem{ Text="Carrier, Self-Insured Employer, Fund (Company)", Value = "CARRIER" },
new SelectListItem{ Text="Employer Contact Person (Person)", Value = "EMP_CONT" },
new SelectListItem{ Text="Employer (Company)", Value = "EMPLOYER" },
new SelectListItem{ Text="Injured Employee (Person)", Value = "IE" },
new SelectListItem{ Text="Other Contact Person (Person)", Value = "OTHERCONT" },
new SelectListItem{ Text="Other Company (Company)", Value = "OTHERCOMP" },
new SelectListItem{ Text="Rehab Provider Company (Company)", Value = "REHABCO" },
new SelectListItem{ Text="Rehab Provider Contact Person (Person)", Value = "RHC_CONT" },
new SelectListItem{ Text="Rehab Provider (Person)", Value = "QRP" },
new SelectListItem{ Text="Third Party Administrator (Company)", Value = "TPA" },
new SelectListItem{ Text="Vendor (School, Bookstore, Training Facility, etc.) (Company)", Value = "VENDOR" },
new SelectListItem{ Text="Vendor Contact Person (Person)", Value = "VEND_CONT" }}, new { @Class = "form-control", @Style = "max-width:400px;height:35px;resize:horizontal" })
@Html.LabelFor(m => m.Search_Company, htmlAttributes: new { @Class = "control-label col-md-2", id = "Search_Company_Label" })
@Html.TextAreaFor(m => m.Search_Company, new { @Class = "form-control", @Style = "max-width:400px;height:35px" })
@Html.ValidationMessageFor(m => m.Search_Company, "", new { @Class = "text-danger" })
The text was updated successfully, but these errors were encountered: