ASP.NET MVC : sorting column of my webgrid executes the wrong action

44 Views Asked by At

I am stuck on this problem: I have an ajax button to add a gridview in a page, so far it works but when I want to sort on one of the columns, it sends me to a page with the result of my gridview

enter image description here

enter image description here

@using (Ajax.BeginForm("GetDataGridDoc", new AjaxOptions
                                             {
                                                 HttpMethod = "GET",
                                                 InsertionMode = InsertionMode.Replace,
                                                 UpdateTargetId = "ResultDataGrid",
                                             }))
{
     .........
     <div id="ResultDataGrid">
        @if (Model.DatepickerBegin != null && Model.DatepickerTo != null)
        {
            {Html.RenderAction("GetDataGridDoc");}
        }
   </div>
}

In my action:

IEnumerable<Document> test = _resultRecherche.ListeDesDocuments.ToList();

return PartialView("_ResultatRecherche", test);

Do you have an idea ?

Thank you

1

There are 1 best solutions below

0
Neotof Tof On

Ok i found, this is pudding Ajax paramètre in m'y webgrid...