0

I have a GridMvc.Html in my web app.

My Requirement On Click of the Paging\Sorting functionality I want it to hit HTTPPOST Action Method.

Currently it hits only HTTPGET.

I have tried using jQuery, it doesn't work and I am not sure on it too.

EDIT This is my Grid in the View

@Html.Grid(Model.SignalDataList).Columns(columns =>
{
    columns.Add(s => s.SignalName).Titled("Name");
    columns.Add(s => s.TimeReceived).Titled("Time Received").Filterable(true);
    columns.Add(s => s.Value).Titled("Value").Filterable(true);

}).WithPaging(10).Sortable(true)

c

Each click on page goes to HTTPGet. SO the data I have selected\filtered via DropDown cannot be handled.

public ActionResult AlarmSignalData()
    {
        SignalDataRepository signalDb = new SignalDataRepository();
        ...
        try
        {
           GetData();
        }
        catch(Exception ex) { return View("Error", new HandleErrorInfo(ex, "SignalData", "AlarmSignalData")); }
        return View(signalDataView);
    }

But I want it to hit HTTPPOST , coz I want to process selected data in trextbox\DropDownlist in my View So in HTTPPOST I pass my model, from Where I can take the TextBox\DropdownList values to fetch filtered data

[HTTPPOST]public ActionResult AlarmSignalData(Model model)
    {
        SignalDataRepository signalDb = new SignalDataRepository();
        ...
        try
        {
           GetData(model.SelectSignal,model.FromDate,model,ToData);
        }
        catch(Exception ex) { return View("Error", new HandleErrorInfo(ex, "SignalData", "AlarmSignalData")); }
        return View(signalDataView);
    }
jAntoni
  • 591
  • 1
  • 12
  • 28
  • 1
    do you have any code to add or shall we just make some up? – Sean T Aug 23 '17 at 17:42
  • if you registered the parameters in the method with the same name of get request the values will deliver to the server if that what you searching for ?! – moath naji Aug 23 '17 at 22:47
  • On click of the paging\sorting of _Grid.MVC_ I want it to hit the _HTTPPOST_ method , so that I will be able to fetch the filtered data calling the method `GetData(signalName,FromDate,ToDate)` (which is inside the _HTTPPOST_ method) - with the model data . Currently paging\sorting click hits the _HTTPGET_ where I don't have model variables to handle & fetch the filter data. – jAntoni Aug 24 '17 at 05:02
  • Any idea on how to get the Grid's clicks to HttpPost method? I appreciate any help on this. Thanks in advance. – jAntoni Aug 28 '17 at 17:47

0 Answers0