Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

500 (Internal Server Error)

$
0
0

Hi everyone. when I am running my code I got a error " Failed to load resource: the server responded with a status of 500 (Internal Server Error)" I am using two tables one is Order and OrderDetails, there are relationship between them.

This is my index javascript code:

<script>
$(document).ready(function () {
$("#ordenTrabajo").DataTable({
"ajax": {
"url": "/Home/GetData",
"type": "GET",
"datatype": "json"

},
"columns": [
{ "data": "OrderID" },
{ "data": "OT" },
{ "data": "Cliente" },
{ "data": "Tipo" },
{ "data": "NumParte" },
{ "data": "FechaIni" },
{ "data": "FechaFin" },

]

});

});
$.fn.dataTable.ext.errMode = 'throw';
</script>

This is my Control code:

public class HomeController : Controller
{
// GET: Home
public ActionResult Index()
{
return View();
}

public JsonResult GetData()
{
InselDBEntities1 dc = new InselDBEntities1();
List<Order> orderList = dc.Orders.ToList();
return Json(orderList, JsonRequestBehavior.AllowGet);
}

}

Image with more details. 

https://drive.google.com/open?id=1SPBdSNOAiwAHwtSUEvTFExJCczQdrj6Q

Please help me out!!!

Thanks. 


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>