Can you guys please check this MapRoute,
routes.MapRoute(
"Topic", // Route name
"{controller}/{action}/{letter}", // URL with parameters
new { controller = "Topic", action = "Letter", letter = UrlParameter.Optional } // Parameter defaults
);
I'm passing an object named "letter". This is a string. The problem that I encountered here is this, when I pass it using the .RouteLink() function
@Html.RouteLink(item, "Topic", new { controller = "Topic", action = "Letter", letter = "A" })
The result is null, for letter.
public ActionResult Letter(string letter)
{
return View();
}
Is there a way wherein I will pass a string type on the MapRoute ? Thanks.
You can do like this