I am working with mvc 4 and jQuery. If I try it this works
var obj = new Object();
obj.name = "Raj";
obj.age = 32;
obj.married = false;
var jsonString= JSON.stringify(obj);
alert(jsonString);
But if I try to convert to my object to JSON it does not work
var obj = new Object();
obj.name = "Raj";
obj.age = 32;
obj.married = false;
obj.Venta=@Model;
var jsonString= JSON.stringify(obj);
alert(jsonString);
As you see I added @Model then this does not work.
I need convert this object to JSON and this would be great if there is a automatic way for get it
public class VentaProd
{
public IEnumerable<product> ListadoProductos {get; set;}
public IEnumerable<account> ListadoClientes { get; set; }
public sale Venta { get; set; }
}