I am working on MVC 5 project.
string hdPrimUserFirstReg = "{\"ProjectName\":\"wwwwwww\",\"ClientName\":\"asdw\",\"ProjectType\":\"2\",\"ProjectLocation\":\"asdfasdfs\",\"Status\":\"Completed\"},\"Form6\":null}","hdPremUserProject":"","hdclientLogo":"","hdProjectTitle":"","ProjectName":"eeeeeee","ClientName":"asdwedfswe","ProjectType":"1","ProjectLocation":"dfwea","Status":"Completed}";
I want to create a list of ProjectName from the variable hdPrimUserFirstReg JSON format data and also from the Form 5 into the public IList<string> listProjectName { get; set; }
And this is my java-script,
AddProjectList: function (e) {
debugger;
if (this.validateForm()) {
debugger;
var hidvalue = $('#hdPrimUserFirstReg').val();//// hidden field from same form
var hidJson = JSON.parse(hidvalue);
var json = {};
$.each($('#frmSubmitPremUserRegFirst').serializeArray(), function (i, field) {
json[field.name] = field.value || '';
});
hidJson.Form5 = json;
var str = JSON.stringify(hidJson);
$('#hdPrimUserFirstReg').val(str); // hidden field from same form
}
},
Error: cannot deserialize the current json object (e.g. {“name”:“value”}) into type 'system.collections.generic.list`1
How can I do this ?
Please help me...
