views:

20

answers:

1

I have a view containing a number of fields

<div class="editor-label">
    <label for="Supplier">Supplier</label>
</div>

<div class="editor-field">    
    <input id="Supplier" name="Supplier" type="text" value="Swifts Antiference Division Ltd" />
    <input id="SupplierId" name="SupplierId" type="hidden" value="1" />

</div>

<div class="editor-label">
    <label for="Scheme_Group">Group</label>
</div>
<div class="editor-field">    
    <select id="Scheme_Group_Id" name="Scheme.Group.Id"><option value="">Select group</option>
<option value="3">Gels</option>

<option value="2">Gloves</option>
<option selected="selected" value="1">Needles</option>
<option value="4">Soap</option>
</select> 

The problem I am having is when the form these fields are contained within is submitted to teh controler action only some of the values are received by the action. The Supplier and SupplierId fields work as expected but the "Scheme_Group_Id" is never populated.

A: 

You should also post how your action is declared and what type are you passing to the view.

Please check the binding in the action parameters, something like this :

public void Edit([Bind(Prefix = "ClassName")]string fieldName){ ...action code...}

More information in here MSDN

Carlos Fernandes