Kumar AU

Kumar AU

  • 1.1k
  • 309
  • 61.9k

Displaying the error message in TryUpdateModel in MVC4

Jan 30 2018 8:31 PM
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)