I am trying to generate JSON. The data is there but it is my understanding that I need to serialize it for it to work. I'm a beginner in C# so the documentation on the newtonsoft site is a bit foreign to me. Here is my C# code.
public partial class Pages_ChartTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static IEnumerable<procReportSalesCountsResult> jsonData()
{
using (OpsDBDataContext dc = new OpsDBDataContext())
{
return dc.ReportSalesCounts().ToList();
}
}
}
What is my final step to serialize. I pulled this data in using Linq To SQL in ASP. Thank you all.