views:

618

answers:

6

FireFox is set to my Windows default browser.

I want to change the default browser used by Visual Studio for debugging. Normally the route I'd take to do this is right clicking on an .aspx file and setting the default from the Browse With... dialog.

Unfortunately, ASP.NET MVC Views don't have the Browse With... option.

alt text

What other ways can you set the default browser for ASP.NET MVC projects?

Related, but NOT ASP.NET MVC Specific:
Visual Studio opens default browser instead of IE

A: 

answer here

redsquare
+6  A: 

There appears to be an answer here

If you right click on any page other than default.aspx you will not get the "browse with" option.

So, when working on an ASP.NET MVC application, right click on default.aspx and chose "Browse With..." Then you'll get a dialog that will allow you to change your default browser.

Matthew Jones
A: 

1) Right click on a .aspx page in your solution explorer

2) Select the "browse with" context menu option

3) In the dialog you can select or add a browser. If you want Firefox in the list, click "add" and point to the other browser name (ex:firefox.exe) filename

4) Click the "Set as Default" button to make this the default browser when you run any page on the site.

joe
See my post - 'Normally the route I'd take to do this is right clicking on an .aspx file and setting the default from the 'browse with' dialog. Unfortunately, MVC views don't have the browse with option.'
Kirschstein
Right click on a .aspx page in your solution explorer
joe
@Chells: For MVC projects, that only works if you click on default.aspx, not just any aspx page.
Matthew Jones
+6  A: 

For MVC1:

  • there is a default.aspx just right click on the page and select browse with and a dialog pops out for you to set your default browser.

For MVC2:

  • we need to trick the project a little bit. There are 2 ways
    1.) You can add default.aspx on the project, just right click on the project and add a new item then select MVC 2 view page and then name it default.aspx and there you can right click it and do the same steps on changing the default browser for mvc1.

    2.) You can add an html page anywhere within the project and after adding it just right click and select browse with and just do the same steps on changing the default browser for mvc1.

Please vote if this post helped you! Thank you!

+1  A: 

For an ASP.NET MVC 2 project in Visual Studio 2010 I've found that

  • you need to have an .aspx file in the root of the project (the folder where also global.asax and web.config is located). Having an .aspx file in any subfolder like "Views" is not sufficient.
  • the name of this .aspx file doesn't matter, it isn't necessary to name it default.aspx

Then the context menu offers a Browse with... option when right-clicking on this file in the solution explorer.

Slauma