In answer to your first issue, you should be including all data that is required in the postback (the form submisson) within the form tags
Anything outside the tags won't be included as part of the post data
There is an MVC helper which you can use for this which makes it nice and easy:
@using(Html.BeginForm("x/y/z"))
{
// Html/Razor for your controls/inputs here
}
You also need to include any data you want to send back to the model in the postback - if you don't include it it won't be there. You can either get the data in the postback scenario (on the controller action) or pass it back in the post data by including it in the form.
If you want to hide it from the users view, you can make it a hidden element:
@Html.HiddenFor(m => m.SomeProperty)
The second issue you have is that the model binder uses reflection to create instances of your model types to rehydrate your model from the post data.
Full details can be read here: http://msdn.microsoft.com/en-us/magazine/hh781022.aspx
This means that any types that you use as part of your model need to have a parameterless constructor in order for the model binder to create an instance and inject the post data.
You are using SelectList
on your model, this does not have a parameterless constructor and should really only be used to represent a selectable list of items in the view. The model binder can't instantiate an empty SelectList
to fill with the post data because of this and therefore throws the observed error
In order to make this work, you should use another type that does have a parameterless constructor or create your own type which contains the fields you need. You can probably use KeyValuePair<K,V>
to represent your selectable data, or you might want to just create an explicit class