Is it possible to use a TextBoxFor to send value to two fields in a model
Posted on 2015-01-03
I have a Create View which I am using a ViewModel to send the values to two classes but there is 2 fields which are needed in both classes so rather than making somebody fill in these 2 fields twice I am trying to see if it is possible to use it to write to both classes in the model.
I have tried a few ideas but it seems I'm trying to aim in the dark.
An example of what I am thinking but is
@Html.TextBoxFor(model => model.class1.customerID, model => model.class2.CustomerID)
which I know wont work but it gives an idea what I'm trying. I would greatly appreciate anyone who can guide me in the right direction how to go about this.
Thanks in advance