I have a registration page that asks for your given Country and State. This is all fine and dandy when you are from a Country that has states like in the U.S, but when you are from a country that doesn't have states I would like to leave the state field blank and still allow you to register and submit the page still.
In my DB table for Country I have a column set boolean true if they have states and false if they don't. This way when someone selects a country with states it loads the states in the drop down menu.
I have the model set up like such.
[Required(ErrorMessage = "State is required.")]
public string StateId { get; set; }
I tried to make the value nullable but that seem to have no effect. So Is it even possible to do validation like this using DataAnnotations?