Hi , as far as you would like to get this data with help of JQuery , i suggest to U
instead of Action return Json data.
For example lets assume that we have such entity
public class Exam
{
public DateTime To { get; set; }
public DateTime From{ get; set; }
public string Description { get; set; }
public int Score { get; set; }
}
so lets define our controller:
public class ExamController:Controller
{
public JsonResult GetExams([FromUri]DateTime from, [FromUri]DateTime to)
{
List<exam> exams = Exams.GetExams(from, to);
return this.Json(exams,JsonRequestBehavior.AllowGet);
}
}</exam>
and the last thing that remains is to make ajax call with help of jquery:
$.ajax({
type: 'GET',
url: '/Exam/GetExams',
data: json,
contentType: 'application/json; charset=utf-8',
success: function (jsonData) {
}
});