Reputation: 933
I have an ASP MVC 5 Application, and i'm using routing attributes, i have a Demo action in a Company Controller, this action is the default one for my web site :
When i run the web site everything is good and the default action is the Demo action, but in the navigation bar of my browser the url is : localhost/:54973/, what changes do I have to do in order to get an url like : localhost/:54973/Company/Demo/isin
[HttpGet]
[Route("~/", Name = "default")]
[Route("Demo/{isin}")]
public ActionResult Demo(string isin= "isin")
{
//code
}
Upvotes: 1
Views: 101
Reputation: 439
When you run the server your IDE will send the start page and the Framework will determine the routes to use.
So you have to configure your IDE. If it is Visual, go to the properties of yoour MVC5 project and in the web options, you will find the start page. Just enter the desired URL.
FYI, you should use this attribute [Route("Demo/{isin?}")], isin will be optional.
Upvotes: 1