I need to display the data returned from my controller class of type JSON in HTML table on View.
Below are the details.
Controller class
ROCRespository rocrep = new ROCRespository();
public JsonResult ROC()
{
return Json(rocrep.GetAllRocDetails(),JsonRequestBehavior.AllowGet);
}
Model Class:
public class ROCRespository
{
public List<ROC> roc;
public ROCRespository()
{
this.roc = new List<ROC>()
{
new ROC(){CourseId="1",CourseName="Softskill 321 : Client Interaction through conference call",CourseImagePath="../../Content/Images/php.png"},
};
}
public List<ROC> GetAllRocDetails()
{
return roc;
}
}
I need to display the details in my view as HTML table.
Edit:
Currently I am getting an output like,
[{"CourseId":"1","CourseName":"Softskill 321 : Client Interaction through conference call","CourseImagePath":"../../Content/Images/php.png","rating":0}]
Need to display in a neatly designed table or div's