1

This is my controller:

public ActionResult GetFilterUsers(int pageNumber)
{

    //......

}

This is my js code:

$('#users-data-table').DataTable({
            serverSide: true,
            ajax: {
                url: "@(Url.Action("GetFilterUsers", "Users", new { area = "Admin" }))/" + table.page.info().page, 
                type: "GET"
            }
        });

this string is now working

url: "@(Url.Action("GetFilterUsers", "Users", new { area = "Admin" }))/" + table.page.info().page, 

How can I pass table.page.info().page into my controller?

1
  • remove type part from ajax and check Commented Dec 8, 2015 at 17:57

1 Answer 1

1

Change the url to

url: '@(Url.Action("GetFilterUsers", "Users", new { area = "Admin" }))?pageNumber=' + table.page.info()

Now url will pass pageNumber in query string. If you want to pass the url as url: "@(Url.Action("GetFilterUsers", "Users", new { area = "Admin" }))/" + table.page.info().page then you should define and register the route and action route.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.