LINQ to JSon response

I have posted my class below and with sample data. I need to pass this class as an json response.

[Serializable]
public class Student
{
    public string Fname {get;set;}
    public string FirstSemMarkcsv {get;set;}  //This should hold marks as comma separated values.
    public string SecondSemMarkcsv {get;set;}  //This should hold marks as comma separated values.
}

Sample Data

Fname     FirstSemMark       SecondSemMark
John               95                  90
John               80                  93
John               70                  80
Peter              60                  78
Peter              80                  80
Peter              90                  85

I need to pass this as json response.

Any thoughts please.

Regards,

Ashish

Answers


List<Student> students = GetStudentList();
return Json(students));

Need Your Help

Where do I put code that I need to run on all web pages in Play Framework?

java model-view-controller playframework

I apologize in advance for this somewhat ignorant question, but I have researched this as much as possible on my own over the last week. My last resort was to come here because I know the folks on ...

How to bind HammerJS events to KineticJS shapes?

jquery html5 kineticjs multi-touch hammer.js

I'm trying to combine HammerJS with KineticJS. I found some examples and tipps online, but it doesn't work for me.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.