if you have this class on both side it it will work perfectly
public class Person
{
public string name { get; set; }
public string age { get; set; }
public string gender { get; set; }
public string getClassSerialized()
{
return new JavaScriptSerializer().Serialize(this);
}
public Person getClassDeserialized(string sSerializedClass)
{
return new JavaScriptSerializer().Deserialize<Person>(sSerializedClass);
}
}
to get the class back you may get it like this :
var myPerson = new Person().getClassDeserialized(sSerializedClass);