I am using JQGrid with my mvc code.
My controller is
//
// GET: /Leave/
public ActionResult CompOff()
{
var compoffs = db.RegisterCompOffs.Where(l => l.Employee.Id == this.EmployeeId).ToList();
return Json(compoffs, JsonRequestBehavior.AllowGet);
}</code>
compoffs is not null here.. and my view is
@model AGS.Hrms.Models.RegisterCompOff @{ ViewBag.Title = "CompOff"; } <table id="jqgProducts" cellpadding="0" cellspacing="0"></table> <div id="jqgpProducts" style="text-align:center;"></div> <script src="@Url.Content("~/Scripts/jquery.jqGrid.min.js")" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $('#jqgProducts').jqGrid({ //url from wich data should be requested url: this.href, //type of data datatype: 'json', //url access method type mtype: 'GET', //columns names colNames: ['CompOffDate', 'IsApproved', 'Description', 'ExpiryDate','IsUtilized'], //columns model colModel: [ { name: 'CompOffDate', index: 'CompOffDate', align: 'left' }, { name: 'IsApproved', index: 'IsApproved', align: 'left' }, { name: 'Description', index: 'Description', align: 'left' }, { name: 'ExpiryDate', index: 'ExpiryDate', align: 'left' } { name: 'IsUtilized', index: 'IsUtilized', align: 'left' } ], //pager for grid pager: $('#jqgpProducts'), //number of rows per page rowNum: 10, //initial sorting column sortname: 'CompOffDate', //initial sorting direction sortorder: 'asc', //we want to display total records count viewrecords: true, //grid height height: '100%' }); }); </script></code>
While requesting for this view I'm getting this 500 Internal server error in console window of Firebug. Can some one tell me what im doing wrong here?