I know it's a basic question, but I am not sure where is my issue. I've created a routing like the following:
routes.MapRoute
(
name: "Searching",
url: "Search/{para1}/{para2}/{para3}",
defaults: new
{
controller = "Search",
action = "Index",
para1= 0,
para2= 0,
para3= 0
});
public ActionResult Index(int para1, int para2, int para3)
{
ViewBag.para1= para1;
ViewBag.para2= para2;
ViewBag.para3= para3;
return View();
}
By my understanding if I pass a link http://domain.my/search/1/0/1 it should open the given action with the parameters, assigning them as per the order in the request, but in my case I am receiving a 404 error.
Am I mistaking the way that parameters work with the routing or is it some other issue? As I read what I found through google that should be correct, but I am not sure where is my error. Can anyone point me in the right direction?