I am using the following route in ASP.NET MVC:
routes.MapRoute(
"Default",
"{controller}/{action}/{id}",
new { controller = "UserInformation", action = "Index", id = "1" }
);
Every time I try to navigate to this route, I actually get the directory to open ion the browser, but if I try it with a hardcoded URL (http://example.com/UserInfromation/Index/1), I get the correct page.
What am I doing wrong?
It is a limitation of the Visual Studio development web server that it behaves like this when you browse to a “directory” rather than to a specific URL – you’ll see the same effect in a forms application.
If you’re able to run the application under IIS you should see the result you expect (and for this reason you may want to consider using IIS Express for your local development server, though as I haven’t taken this step I can’t yet comment on how well it works).