asp.netasp.net-mvcasp.net-mvc-3

In my MVC 3 .NET application, how do I change the URL in the address bar on website startup?


When I start debugging my MVC web application, the URL in my address bar is the following:

http://localhost:#####/

And this calls the Home/Index route. Is there a way to have the Home/Index part included when I start debugging in the address bar like this:

http://localhost:#####/Home/Index

I don't quite understand why the address does not display the Home/Index part in the first place. Can someone clarify this?


Solution

  • Just set it up in Project|Properties:

    enter image description here

    Select Specific page and set it to: Home/Index

    But do consider how a real visitor will be coming to your site, and what you want to happen.