Click here to Skip to main content
14,836,727 members
Please Sign up or sign in to vote.
4.83/5 (5 votes)
In Visual Studio 2010, you can right-click an aspx page in a web forms app, or on the web forms app itself in the solution explorer, and you get "View in Browser" in your context menu.

In ASP.NET MVC projects, this item doesn't seem to be available in the context menu. The only way I know to run the app is to set the MVC app as a startup project and hit CTRL+F5. But, if there are two MVC apps in the solution, this doesn't really work. How do you accomplish this for mvc apps?

In my scenario, There are multiple users working on application on different controllers/view, How could they execute their view without changes the routes in Global.asax ?

The most simplest way to accomplish your first requirement is to add a plain-old html file. Once you add a html file to your MVC project and right click on it, you will magically start seeing the Browse With and View In Browser options!

Coming to your next question, what do you mean by they have to execute without changing the routes? They just have to enter the appropriate url in the browser or bookmark once isn't it ? In case you are talking from a developers perspective every one of them can set a specific page to open every time they start debugging. To do this, right click on your mvc project, choose Properties, then select the Web tab and then in the right pane, select Specific Page and enter the url say "Home/Index".

Your second part of the question isn't clear. Do elaborate!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900