c# - ArgumentException: The parameters dictionary contains an invalid entry for parameter -
there different action in controller. 2 links, 1 each action (as menu) clicking on each work without problem, switching between 2 actions clicking on links raises following error (sometimes)
[argumentexception: parameters dictionary contains invalid entry parameter 'vm' method 'system.web.mvc.actionresult overview(poject.areas.area1.models.viewmodel2vm)' in 'poject.areas.area1.controllers.controllera'. dictionary contains value of type 'poject.areas.area1.models.viewmodel1vm', parameter requires value of type 'poject.areas.area1.models.viewmodel2vm'. parameter name: parameters] system.web.mvc.actiondescriptor.extractparameterfromdictionary(parameterinfo parameterinfo, idictionary`2 parameters, methodinfo methodinfo) +733
most of times works, error displayed. viewmodelclasses inherit same viewmodelbase class. reason?
any welcome
the error seems clear: need type poject.areas.area1.models.viewmodel2vm
, in cases passing type poject.areas.area1.models.viewmodel1vm
.
if viewmodel1vm
amd viewmodel2vm
more or less equivalent, perhaps can solve creating common class inherit from, , use parameter type, method overview()
accept both types.
Comments
Post a Comment