Issues getting data to display in partial views ASP.NET MVC

Issues getting data to display in partial views ASP.NET MVC

SrlivingstonSrlivingston Posts: 2Questions: 0Answers: 0
edited March 2013 in General
I'm having issues getting my data to display in my view in my MVC project. When I load the page based on the value I send it all the controls pop up, but no data. I'm only trying to use DataTables on the PartialSlagView right now so that is where the issues are. Any help is appreciated.

The code in my view that calls the partial view looks like this:
[code]
@if(ViewBag.SearchKey != null)
{


@Html.Action("PartialChemAnalysis", "Home", (string)ViewBag.SearchKey)

@Html.Action("PartialSlagView", "Home")

}
[/code]

The code in my partial view looks like this:

[code]





$(document).ready(function () {
var oTable1 = $('#myDataTable').dataTable({
"bServerSide": true,
"sAjaxSource": '/Home/AjaxCall',
"fnDrawCallback": function () {
$('#myDataTable tbody td:nth-child(2)').editable('/Home/Write/', {
"callback": function (sValue, y) {
oTable1.fnDraw();
},


});
}
});
})




Analysis ID
Name
Analysis Time
Sample Type
Grade
Product ID




[/code]

The code in my controller looks like this:

[code]
public ActionResult PartialSlagView()
{
return PartialView();
}


public ActionResult AjaxCall(jQueryDataTableParamModel param)
{
PartialSlagViewModel D = new PartialSlagViewModel();
IEnumerable model = D.SlagList;
D.SlagViewDataPull(heatName);

return Json(new
{
sEcho = param.sEcho,
iTotalRecords = D.SlagList.Count(),
iTotalDisplayRecords = D.SlagList.Count(),
aaData = D.SlagList
},
JsonRequestBehavior.AllowGet);
}
[/code]
This discussion has been closed.