Hello,
I'm trying to refresh a table after updating it on the codebehind and despite every change I do I keep getting this error.
The codebehind is doing its job, after I return the partialview, it populates the table but nothing happens because I still haven't figured out how to solve this error. Can you please help me?
JScript
And in the codebehind I have something like this:
C#
What am I doing wrong?
I'm trying to refresh a table after updating it on the codebehind and despite every change I do I keep getting this error.
The codebehind is doing its job, after I return the partialview, it populates the table but nothing happens because I still haven't figured out how to solve this error. Can you please help me?
JScript
$(document).ready(function () { var oEntityTable = $('#entityTable').dataTable({ "bFilter": false, "bInfo": false, "bJQueryUI": true, "bServerSide": true, "sAjaxSource": "SearchClients", "sDom": '<"top">rt<"bottom"flp><"clear">' }); }); $(document).ready(function () { $('#btnSearchClients').click(OnBtnSearchClientsClick); }); function OnBtnSearchClientsClick(e) { $.ajax({ url: jqDataUserUrl.Url, type: "POST", cache: false, success: function () { $('#entityTable').dataTable().fnDraw(); }, error: function (xhr, ajaxOptions, thrownError) { //TODO } }); return false; }
And in the codebehind I have something like this:
C#
public ActionResult SearchClients(FormCollection oForm) { var entity = new Entity(); entity.Results = new List<Entity>().ToArray(); GetEntityListIn getEntityListIn = new GetEntityListIn(); //(...) GetEntityListOut GetEntityListOut = client.GetEntityList(getEntityListIn); if (GetEntityListOut != null) { entity.Results = GetEntityListOut.Entity; ViewBag.Results = entity.Results; return PartialView("AddClient", entity); } return PartialView("AddClient"); }
What am I doing wrong?