混合MVC路由的MVC应用程序在Web窗体应用程序 [英] mixed MVC routing for MVC app under web forms app

查看:133
本文介绍了混合MVC路由的MVC应用程序在Web窗体应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有BlogEngine.net的一个实例安装在我的托管服务器的根目录。我想与ASP.Net MVC发挥写一个小的应用程序,并关闭根文件夹下安装该应用程序。

I have an instance of BlogEngine.net installed at the root of my hosted server. I wanted to play with ASP.Net MVC to write a small app and installed that app under a folder off the root.

我能看到 http://example.com/testApp/ 但该路由页面如 http://example.com/testApp/edit 是给404的。

I am able to see the http://example.com/testApp/ but the the routed pages like http://example.com/testApp/edit are giving 404's.

我已经搜索周围,我只是不清楚什么是需要得到正确的路由。我是否需要设置东西BlogEngine的web.config或做我需要做在我的应用程序设置的东西吗?

I have searched around and I'm just not clear what is needed to get the routing right. Do I need to set something in BlogEngine's web.config or do I need to be doing something in my applications settings?

主持人是WinHost.com,这是IIS7

The host is WinHost.com and it is IIS7

修改/更新

于是我明白, http://example.com/testApp 被提供服务,因为有一个默认的。 ASPX该目录下并且该路由网页不得到服务,因为它们不具有物理的aspx的。在/编辑被路由到编辑视图就好了,当我启动它的Visual Studio之下。

So I understand that the http://example.com/testApp gets served because there is a default.aspx under that directory and that the routed pages don't get served because they don't have physical aspx's. The /edit gets routed to the edit view just fine when I launch it under Visual Studio.

我猜测的BlogEngine.net的Global.asax中试图对这些网页的BlogEngine世界地图,而不是它们路由到我的testApp。

I am guessing that the BlogEngine.net's global.asax is trying to map these pages to the BlogEngine world and not routing them to my testApp.

如果是那么我的问题是我如何获得BlogEngine到将请求转发到我的testApp的情况?我希望我失去了一些东西简单在web.config,因为如果我要的东西添加到BlogEngine的Global.asax中做那么路由就不会,我需要重建BlogEngine?

If that is the case then my question is how do I get BlogEngine to forward the requests to my testApp? I was hoping that I was missing something simple in the web.config because if I have to add stuff to BlogEngine's global.asax to do routing then won't I need to rebuild BlogEngine?

推荐答案

根据我在的 MVC教程,我发现,为什么我的路由不能正常工作。

Based on the information I found in the MVC tutorial, I have discovered why my routing wasn't working.

我的托管服务器上请求处理模式被配置为使用经典.net程序池没有集成模式。为了得到它你需要进行修改路由表使用的文件扩展名或创建一个通配符脚本映射的经典模式。

My request processing mode on the hosted server was configured to use the Classic .NET AppPool not Integrated mode. To get it to work in classic mode you need to either modify the route table to use file extensions or create a wild card script map.

我能够保持BlogEngine使用集成模式下工作,所以一切我需要解决这个问题是要改变模式。

I was able to keep BlogEngine working using integrated mode so all that I needed to resolve this issue was to change the mode.

希望这可以帮助别人...

Hope this helps someone...

这篇关于混合MVC路由的MVC应用程序在Web窗体应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆