1
Answer

Displaying the error message in TryUpdateModel in MVC4

Kumar AU

Kumar AU

7y
597
1
My Code :-
 
if (TryUpdateModel(model))
{
//My Logic
}
else
{
ActivityLogger.LogActivity("HandleReceiverAddressSubmitted Method" + ModelState.Values);
}
 
Here in "ModelState.Values" rather then giving the actual error message its showing as 'System.Collections.Generic.Dictionary`2+ValueCollection'
 
Could you please help me how do I Log the error message If any error occurred in the TryUpdateModel in MVC4 in my code.
Answers (1)