sam
sam

Reputation:

What's the best way to implement friendly URL in ASP.net?

What's the best way to implement friendly URL in ASP.net?

Upvotes: 3

Views: 535

Answers (4)

cori
cori

Reputation: 8810

If you're looking to do this in earlier versions of the .Net Framework, you can use the RemapURL tool from the IIS 6.0 Resource Kit. We use it, and all it takes is installing the dll, creating a very simple ini file with your friendly urls and their associated endpoints, and enabling the dll in Web Service Extensions Very simple how-to here.

Upvotes: 0

Marko Dumic
Marko Dumic

Reputation: 9888

I have used UrlRewriter.Net library. It is small but powerful and easy to configure.

Upvotes: 0

Soraz
Soraz

Reputation: 6746

The best way to do this is to look into the new MVC toolkit from microsoft (http://www.asp.net/mvc/)

See http://weblogs.asp.net/scottgu/archive/2007/11/13/asp-net-mvc-framework-part-1.aspx for an example.

Sure, its only beta right now, but the core of it is the routing system that makes it possible to make intelligent urls based on actual content.

I.e. to edit product with id 5 you'd have an url that looked like /Product/Edit/5

If I read the specifications correctly, you can use this routing system for anything (i.e. so you don't have to recode the entire site to use it), and it can default to allow direct references to an existing file to have precedence over its own rules (i.e. /myfile.aspx will still use the file, instead of a route). That way you can mix and match the technologies and urls while you make the trancendance to the new routing based system.

Upvotes: 0

chakrit
chakrit

Reputation: 61518

The ASP.NET Routing Framework provided in .NET 3.5 SP1 is a good one.

Although it is very new, it can handles many URL-related tasks and most frequently used URL-friendly schemes very well.

It can be used outside of MVC, too.

Upvotes: 1

Related Questions