use url for generated pages, no query string

55 Views Asked by At

I want to generate pages with asp.net. I have one page with the content I will show. I know that you can use a query string like this:

www.mysite.com/users.aspx?name=pol

With the code for read and place a query string, I have no problems and works very good.

But for the users it's more friendly to use this:

www.mysite.com/users/pol

How can you do this? I use ASP.NET, the background language is C#.

1

There are 1 best solutions below

1
On BEST ANSWER

You can achieve this using URL Routing.

ASP.Net web forms applications doesn't support URL routing by default, but you can easily implement it by registering routes at the start of your application (in Global.asax file) as shown here -

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