I have read here : Routing with Multiple Parameters using ASP.NET MVC. But still not worked in my case.
I have EmitenController
which there a function like this:
public async Task<ActionResult> Financial(string q = null, int page = 1)
At first load, the URL that produced by this function: Emiten/Financial?q=&page=1
.
The next page of course Emiten/Financial?q=&page=2
.
If I give the query that URL become: Emiten/Financial?q=query&page=1
and go on.
For the routes, I have tried
routes.MapRoute(
name: "Financial",
url: "{controller}/{action}/{q}/{page}",
defaults: new { controller = "Emiten", action = "Financial", q = "", page = 1 }
);
But, when I try go to page 3 the URL still Emiten/Financial?q=&page=2
and how about the URL if I give q
empty value?
Thanks in advance.