How to take parameter to the controller in ASP.NET Core MVC using ajax?

How to take parameter to the controller in ASP.NET Core MVC using ajax?

fa2020fa2020 Posts: 4Questions: 3Answers: 0

Hi,
I have a method in the controller that loads data into DataTable. This method needs an input parameter. I want to take a parameter to the controller. I tried this ajax call:

But when I debug, the input parameter is null.

How can solve this problem?

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,261Questions: 26Answers: 4,934
    Answer ✓

    Use the ajax.data as a function otherwise it will be static data. There is an example in the docs plus this running example.

    Kevin

Sign In or Register to comment.