views:

142

answers:

4

I have a small task to do, and figured it would be better to start here than doing it wrong then coming here again. I need to replace my URLs with a more friendly format as the following: Current: www.MySite.com/default.aspx?userID=XX I want it the users to type : www.MySite.com/user/(UserName)

Also, Current: www.MySite.com/default.aspx?userID=XX&ref#XX I want the users to type: www.MySite.com/user/(UserName)/ref#{refno}

Thanks in advance

PS: I do not want to use Asp.net MVC.

A: 

If you can, I'd just use IIS7 URL Rewriting for that. Your mapping configuration can go in your web.config, and you wouldn't have to change your application at all.

Jon Galloway
Cool, and how can I do it?! :)
Maen
A: 

scott guntrie posted a great tutorial on this http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx

Stephen Binns
+1  A: 

You can use the MVC Routing Feature without using MVC, as it's a separate component built on top of ASP.net.

There is an article on 4GuysFromRolla about this.

Michael Stum
+1  A: 

You can use routing in Webforms:

Using ASP.NET Routing Without ASP.NET MVC

CD