开发者

"Browse with..." option not available on ASP.Net MVC Project

I'm sure this is a simple misunderstanding but I'm trying to change the default browser in Visual Studio 2010 from Firefox (my machine's default) to IE so that 开发者_运维技巧VS will stop debugging when the window closes.

Based on ScottGu's post on the subject, I'm expecting a "Browse with..." option when I right-click on an aspx page in my MVC app; but there's no such option.

Also (possibly unrelated), when trying to launch the ASP.Net Configuration, the Cassini Development Server starts, but no browser instance launches. Starting to get very frustrated!


Asp.net MVC doesn't let you do this

You can only see "Browse with..." when you right click on the Default.aspx on app's root. Otherwise it's just not there.

This menu option obviously isn't stupid and doesn't let you browse a particular view, because it's not up to the browser to request a particular view, but up to a controller that may display some (or any) view... So Visual studio doesn't give you this option on your views.

I suppose it would be best if you've changed your default browser on your development machine.


In ASP.NET MVC 1 projects, you have to right click Default.aspx to get the "Browse with..." option.

However, ASP.NET MVC 2 projects do not have a Default.aspx. The best way to change your default browser is to create a standard ASP.NET project and set the default browser using that.


I'm building an MVC 2 project and encountered this issue. I just created a Default.aspx web form in the root folder, used the Browse With... menu it exposed to set my browser for this particular project to IE, then deleted the Default.aspx. Kind of a pain, but you only (should need to) do it once.


You can add an app_offline.html file to your MVC3 app. This is useful, because if you rename it to app_offline.htm and deploy it, it will cause IIS to deny all requests to the app (and will return the content of the app_offline.htm(l) file).

If you have one of these, you can right-click it to get the browse with option. In case you want to test out with different browsers & window sizes from VS, without a plugin.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜