开发者

What is the easiest way to give nice URLs to my ASP.NET WebForms application?

开发者 https://www.devze.com 2023-01-05 09:37 出处:网络
I have a big, fat, legacy ASP.NET WebForms application with big, fat, legacy URLs: /ViewDocument.aspx?documentId=72143&noRedirect=1&someOtherCrapThatJustSeemsToGoOnForever=AndEver

I have a big, fat, legacy ASP.NET WebForms application with big, fat, legacy URLs:

/ViewDocument.aspx?documentId=72143&noRedirect=1&someOtherCrapThatJustSeemsToGoOnForever=AndEver

What is the simplest w开发者_Python百科ay to implement pretty URLs in WebForms using ASP.NET 3.5? Is there anything in ASP.NET 4 that will make this easier?

Should I implement URL rewriting using an HttpModule?


Yes, you can do with with ASP.NET 4 routing too. Scott Guthrie blogged about this:

http://weblogs.asp.net/scottgu/archive/2009/10/13/url-routing-with-asp-net-4-web-forms-vs-2010-and-net-4-0-series.aspx


The simplest way would be to use an existing URL rewriting component such as urlrewriting.net. It allows you to specify a regular expression transformation on your URLs in your web.config.

0

精彩评论

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

关注公众号