ASP.NET MVC VS2010中更改默认调试浏览器
2014-03-05 16:21
274 查看
In Visual Studio 2010 (RC) there is no longer a "browse with" context menu when right clicking .aspx pages. How can you change the default browser now?
By default it seems to use the operating system default browser, but I would prefer to use IE when debugging ASP.net apps. (I am testing this with ASP.net MVC 2)
在Visual Studio 2010(RC)中右键点击 .aspx 页面已不复存在"browse with"菜单项。那要如何修改调试时使用的默认浏览器呢?
默认情况下,VS会使用操作系统的默认浏览器,但我在调试 ASP.NET 程序时更偏向于使用IE浏览器。(我是测试的是ASP.NET MVC2的网站)
There is no "Browse With" option on the .aspx Views in an MVC project as they are not meant to be directly browseable.
What I tend to do is add a Default.aspx webform in the root of the site and this, when right clicked, will give you the Browse With option. You need to make sure to update your routing though otherwise IIS/Cassini will try
to serve it up, something like this
MVC 工程中的 .aspx 视图没有"Browse With"菜单项是因为它禁止被直接浏览。
我的做法是在网站的根目录下添加一个名为"Default.aspx"的 webform 视图,右键点击它就会看到"Browse With"选项。你需要确认更新你的路由使IIS/Cassini 能够使之运转,比如像下面这样
By default it seems to use the operating system default browser, but I would prefer to use IE when debugging ASP.net apps. (I am testing this with ASP.net MVC 2)
在Visual Studio 2010(RC)中右键点击 .aspx 页面已不复存在"browse with"菜单项。那要如何修改调试时使用的默认浏览器呢?
默认情况下,VS会使用操作系统的默认浏览器,但我在调试 ASP.NET 程序时更偏向于使用IE浏览器。(我是测试的是ASP.NET MVC2的网站)
There is no "Browse With" option on the .aspx Views in an MVC project as they are not meant to be directly browseable.
What I tend to do is add a Default.aspx webform in the root of the site and this, when right clicked, will give you the Browse With option. You need to make sure to update your routing though otherwise IIS/Cassini will try
to serve it up, something like this
MVC 工程中的 .aspx 视图没有"Browse With"菜单项是因为它禁止被直接浏览。
我的做法是在网站的根目录下添加一个名为"Default.aspx"的 webform 视图,右键点击它就会看到"Browse With"选项。你需要确认更新你的路由使IIS/Cassini 能够使之运转,比如像下面这样
public void Page_Load(object sender, System.EventArgs e) { // Change the current path so that the Routing handler can correctly interpret // the request, then restore the original path so that the OutputCache module // can correctly process the response (if caching is enabled). string originalPath = Request.Path; HttpContext.Current.RewritePath(Request.ApplicationPath, false); IHttpHandler httpHandler = new MvcHttpHandler(); httpHandler.ProcessRequest(HttpContext.Current); HttpContext.Current.RewritePath(originalPath, false); }
相关文章推荐
- ASP.NET MVC VS2010中更改默认调试浏览器
- ASP.NET MVC VS2010中更改默认调试浏览器
- (转)ASP.NET MVC VS2010中更改默认调试浏览器
- ASP.NET MVC VS2010中更改默认调试浏览器
- 【ASP.NET】VS2010改变调试默认的浏览器
- ASP.NET调试启动默认浏览器如何设置
- 如何设置调试ASP.NET程序时的默认浏览器
- ASP.NET调试启动默认浏览器如何设置
- IIS 7.5, ASP.NET MVC. HTTP Error 500 (Internal Server Error) 但是调试又不进入后台,浏览器只报500错误
- 如何设置调试ASP.NET程序时的默认浏览器
- 如何设置调试ASP.NET程序时的默认浏览器
- asp.net mvc设置area页面为默认路由
- 设置ASP.NET MVC站点默认页为.html页 .
- 转载 使用Glimpse调试ASP.NET MVC应用程序
- 设置ASP.NET MVC站点默认页为html页
- 使用MiniProfiler调试ASP.NET MVC网站性能
- 安装了VS2010 sp1 后再安装ASP.NET MVC 3.0的问题(Final Result: Installation failed with error code: (0x80070643), "安装时发生严重错误 " (Ela)
- c#ASP.NET MVC 4 Web应用程序创建以及默认起始页配置的由来
- asp.net core 编译mvc,routing,security源代码进行本地调试