I've question about routing in MVC
i've created a simple website i defined a controller called HomeController.cs
defined my public ActionResult WebPage(int id)
the id is the Id of the page i'm displaying my route will look something like:
Current:
http://localhost:5000/Home/WebPage/1
What i want is:
http://localhost:5000/1
My current RouteConfig.cs
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
I've tried allot with different routes in RouteConfig.cs
but im stuck can someone point me into the right direction?
I've searched on StackOverflow something similer to this but didn't find.