ASP.net MVC Using view models in different views
- by Azhar Rana
i have 2 customer views one for create and one for edit. i am using the same Customer view model for both. i want to make the 'customer no field' required on the add but not the edit.
if i put the requiredfield attribute on the view model property then both views flag 'Customer No' as required (as you would expect).
Is there a built in solution to get around this problem or am i going to have to create 2 seperate view models, one with the attribute and one without.
Thanks