Introduction:
Here we will learn how to solve the problem of cannot
deserialize the current JSON
object (e.g. {"name":"value"}) into type
'System.Collections.Generic.List`1[userdetails]' because the type requires a JSON
array (e.g. [1,2,3]) to deserialize correctly. Generally we will get this error
whenever our deserialized JSON
object returning list of object items but we are trying to hold only single
item.
Description:
In previous articles I explained asp.net json serialization and deserialization in c#, vb.net,
asp.net set custom error page inn web.config, unrecognized escape sequence in file path in c#, vb.net, cannot convert string to type double is not valid in vb.net,
jQuery show error message in ajax call response with example,
convert json string to json object with example and many
more articles related to in JSON,
asp.net,
mvc, c#,
vb.net.
Now I will explain how to solve the problem cannot deserialize the current JSON
object (e.g. {"name":"value"}) into type
'System.Collections.Generic.List`1[userdetails]' because the type requires a JSON
array (e.g. [1,2,3]) to deserialize correctly.