I have a class like this :
public class Person
{
public string Address { get; set; }
public string Name { get; set; }
public string Surname { get; set; }
public Person()
{
}
}
on server side, I populate some instance of this class, and I add them into an IEnumerable<Person>.
Well, now, on client side, I’d like to receive this collection as javascript (json?), as happens with web services and serialization. ([Serializable()])
How can I do it in a normal response, after a webform request in .NET 3.5?
You can use JavaScriptSerializer to serialize an object to JSON.
Or, even better, create a WebService marked with ScriptService.