I have this route declaration:
routes.MapRoute(
// Route name
"WhiteLabelPartners",
// URL with parameters
"partners/{partnerName}/{controller}/{action}/{id}",
// Parameter defaults
new { partnerName = "", controller = "", action = "index", id = UrlParameter.Optional }
);
When I try this URL:
/partners/a/savings/index/1
...it works fine. The index action of the Savings controller is hit.
But, when I try this URL:
/partners/a/savings/index
I get a "not found".
If I have a UrlParameter.Optional for the {id} parameter, why is it still being required?
Could anyone explain? How can I make the {id} parameter optional?
Thanks
/partners/a/savings/index/
does it work? – Tejs