SuperUser555
SuperUser555

Reputation: 103

Encoding Urls C#

So I have a URL that looks like this

http://www.test.com/folder1/id=3

But basically when they click the button, in the URL bar i want to display the name of the value associated with that id, for instance id=3 is a watch named "Rollex"

so I want the URL to read

http>//www.test.com/folder1/Rollex

Thank you in advance

Upvotes: 3

Views: 247

Answers (2)

Jeremy Thompson
Jeremy Thompson

Reputation: 65554

You should look up URL Routing, its exactly what you want. See ASP.NET Routing.

Upvotes: 8

Caspar Kleijne
Caspar Kleijne

Reputation: 21864

You need Url Rewriting with ASP.NET

A rewrite engine is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly - SEF) are used to provide shorter and more relevant-looking links to web pages.

The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the World.

This blog post summarizes a few approaches you can take to cleanly map or rewrite URLs with ASP.NET, and have the option to structure the URLs of your application however you want.

Upvotes: 1

Related Questions