开发者

asp.net mvc url routing

i have a classic web project and i want to use asp.net mvc url routing just for rewrite url. is it possible without make much changes to开发者_如何转开发 my web project?


Routing is not part of ASP.NET MVC - it's just part of ASP.NET itself. The good news is that it works with both MVC and WebForms (ASPX files). Check out Phil Haack's blog post on how to get this to work.

The only changes you need to make to your application are to add some configuration items to web.config and then register your routes in global.asax.cs (or global.asax.vb if you're using VB).


System.Web.Routing, while shipped with ASP.NET MVC, is not technically part of the MVC framework. You can in fact use it as part of a regular ASP.NET webforms project.


Definitly possible for .net 4.0, so like in 2 months. Also, google shows alot of content on how to do it today.


As others have said routing is now built into .net 4 and can be used for both mvc and web forms. ScottGu has a post about how to use routing in webforms and can be found here.

Hope it helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜