I'm fairly new to MVC4, and I'm having a problem getting a custom route off the ground.
I don't want to explain what my end goal is, since it's fairly complicated, but right now I simply want this url:
/Home/GetView/contacts/pv
to hit the GetView action of my home controller, and pass it parameters of "contacts" and "pv" for its module
and name
parameters
public PartialViewResult GetView(string module, string name)
Unfortunately when I set a breakpoint, both of these parameters are null
.
Here's the route I'm trying to use
routes.MapRoute(
name: "PartialView",
url: "{controller}/{action}/{module}/{name}"
);
and I've also tried
routes.MapRoute(
name: "PartialView",
url: "Home/GetView/{module}/{name}",
defaults: new { controller = "Home", action = "GetView" }
);
According to the docs I'm reading that should work fine, so I'm not sure what I'm doing wrong.