I have a model:
public class CustomerAttributes
{
public Int Id { get; set; }
public string value { get; set; }
}
my create view looks like this:
<div class="editor-label">
@Html.Label("Name")
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Value)
@Html.ValidationMessageFor(model => model.Value)
</div>
<div class="editor-label">
@Html.Label("Age")
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Value)
@Html.ValidationMessageFor(model => model.Value)
</div>
<div class="editor-label">
@Html.Label("Height")
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Value)
@Html.ValidationMessageFor(model => model.Value)
</div>
So each textbox will be a new record in the database. Is it possible to do something like this? How can I handle this? Also my biggest problem is that each field could be a textbox or a combobox or a radio.... etc... Name might a textbox for example but age might be a combobox.... I know I have all textboxes now but that could change.