This is a long winded question so apologies for that and apologies if I'm being a bit simple.
Basically I have a data collection form that split into various sections (personal info, employer info, etc.). This is for some clients that have local script blocking policies so the use of client side scripting has to be limited.
So basically I've declared my model (simplified):
Public class enrolmentViewModel
{
public string firstname { get; set; }
public string lastname { get; set; }
public string employerName{ get; set; }
public string jobTitle { get; set; }
}
So on the first view (personal) I'm collecting the firstName and lastName and then on submission passing this model to the second view (employer) where I collect the employerName and jobTitle and then pass this onto to another ActionResult and so on and so on.
The problem is that when I pass the model from the second view it's 'lost' the values that were collected in the first view (personal). I'm presuming that this is being caused as the firstName and lastName fields don't appear on the employer view. I'm currently getting round this by including hidden fields on the employer view that contain these values but this model will have about 50 values on it (and there are several more views where the model is being passed to) so on the last view I'll end up with loads of hidden fields just to contain these values so I'm thinking that there must be a more elegant way of doing this.
Could anyone spare me a couple of minutes to point me in the right direction please?
Thanks, C