Trying to learn ASP.NET MVC.
I have created a model for signup form.
I have name, phone etc. Then I have:
[Required(ErrorMessage = "Field is missing")]
[DisplayName("PostalCode")]
public int PostalCode { get; set; }
public string[] City =
{
"New York",
"London",
"LA",
"Unknown"
}
public string[] Team =
{
"Yankees", "Chelsea","Kings",
}
First of, unsure on how to code this in a model, with { get; and set; } ?
Objective with these is to: if postalcode is between 1000-2000 automatically display New York, Yankees on the signup form. And same for 3000-4000, London, Chelsea.
I also want a dropdown for both strings so you can choose whatever you want, and the display should be updated accordingly.
This should all be stored along with the other inputs in a DB.
Quite unsure on how to do this with MVC, so any suggestions?