升级传统的ASP为MVC 4.0 [英] Upgrade classic ASP to MVC 4.0

查看:184
本文介绍了升级传统的ASP为MVC 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在升级,从传统的ASP到MVC 4.0的过程。 MVC项目与模块,视图和控制器独特的文件夹结构。我们传统的ASP网站是很好的索引,搜索引擎,并使用所有友好的URL(有些映射到现有的文件夹和删除网页的扩展,并映射的搜索引擎优化,而不是包含文件的文件夹等),在web.config中使用重写规则。我需要保持当前的所有网址,但它们都映射到比MVC项目将不同的文件夹。我想的MVC项目保持在默认的项目定义的文件夹结构,但还需要继续使用现有的URL。

I'm in the process of upgrading from classic ASP to MVC 4.0. MVC projects have a unique folder structure with modules, views, and controllers. Our classic ASP website is very well indexed in search engines, and uses all friendly URLs (some mapped to existing folders and removing page extensions, and others mapped for SEO and not to the folder containing the files), using Rewrite Rules in web.config. I need to maintain all the current URLs, but they all map into different folders than the MVC project will. I'd like the MVC project to remain in the folder structure defined in the default project, but also need to continue using the existing URLs.

什么是移动到MVC时,用来维护网站的网址,目前最好的方法是什么?是自定义的路由来处理这个问题的唯一/最好的方法?

What is the best way to maintain the current URLs of the site when moving to MVC? Is custom routing the only/best way to handle this?

推荐答案

我客串有四种方法可以做到重写URL,无论你用哪一个,你需要做一些改变。例如,你应该改变你的阅读网址参数的方式。

I gues there are four ways to do rewriting urls, no matter which one you use, you need to do some changes. For example you should change the way you read the url parameters.

我按照这个教程的http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

它帮助了很多。

这篇关于升级传统的ASP为MVC 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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