Let's say I have the following selectlist (Countries) in a ViewModel:
//..
private static string[] _countries = new[] {
"USA",
"Canada",
"Japan"
};
//...
SelectList Countries = new SelectList(_countries, dinner.Country);
//...
And I render a dropdown list in the following fashion:
<%: Html.DropDownListFor(m => m.Dinner.Country, Model.Countries) %>
I noticed that using firebug, I can inject my own values into the DropDownList and that value may be inserted into the database.
What is the best way to validate that there are no injected values (preferably a DRY method)?