I create an internal page that allows trusted users to manually change the settings through the form. The inputs to this setting are a list of settings (of unknown size), each of which has a specific list of values. Then the user can select a value for all or a subset of the parameters.
I tried to illustrate this with my current model for presentation.
public class SetupModel
{
public List<SetupParameter> Parameters { get; set; }
}
public class SetupParameter
{
public string ParameterName { get; set; }
public SelectList ParameterValueList { get; set; }
public int? SelectedParameterValueID { get; set; }
}
My current attempt to pretend for this is:
<% using (Html.BeginForm("Update", "Parameters") {%>
...
<% foreach( var parameter in Model.Parameters ) { %>
<div><%: parameter.ParameterName %></div>
<div><%: Html.DropDownListFor(x => parameter.SelectedParameterValueID, parameter.ParameterValueList, "Please select") %></div>
<% } %>
...
, , , . , , :)