I want parse json string into c# object by JavaScriptSerializer, my json object looks like below:
[{
"text" : "aaaa",
"cls" : "folder",
"checked" : false,
"isconsign" : false,
"myid" : "catalog_1",
"id" : "catalog_1",
"children" : [{
"text" : "vvvv",
"cls" : "file",
"leaf" : true,
"checked" : false,
"disabled" : true,
"myid" : "4456",
"id" : "input_4456"
}, {
"text" : "sdf",
"cls" : "file",
"leaf" : true,
"checked" : false,
"disabled" : true,
"myid" : "4465",
"id" : "input_4465"
}]
But when I declare my C# object like below:
public class TreeViewItem
{
public string text {get;set;}
public string cls {get;set;}
public bool disabled {get;set;}
public bool isconsign {get;set;}
public bool leaf {get;set;}
public string myid {get;set;}
public string id {get;set;}
public bool checked {get;set;}
}
The c# compiler tell me can not declare checked in object or struct. Now, I can't change the checked property in the string send from client, so is there any solution (something like alias) to resolve this problem?
Thanks