views:

121

answers:

3

I am using ASP.NET with VB.NET

I have realize that SEO does not like my page URL's that contain questions marks such as this.........

http://www.erate.co.za/CompanyProfile.aspx?ID=112

Is it possible to change my URL from that to say

http://www.erate.co.za/CompanyProfile/USA

Is this even possible? If so how would i or can i do this in VB.NET? C# code will also do, i will convert it myself to VB.NET

Thanks in advanced!

EDIT:

Note that my URL with the Question Mark in it is reading a record from the DB with the ID of 112

+1  A: 

What you are talking about is called URL Rewriting, and Scott Guthrie has a handy article on this here.

Pete OHanlon
A: 

It is possible by using MVC.I done it with C#,I think VB.NET also supports MVC.You want the URL as stackoverflow right ? .Stackoverflow is developed in MVC architecture.

Edit : you can accomplish the same by ASP.NET Routing also

anishmarokey
Yes i want it like Stackoverflow
Etienne
Then go with MVC architecture : http://msdn.microsoft.com/en-us/library/dd394709.aspx gives more idea :)
anishmarokey
You can also acomplish this using ASP.Net without MVC, the Routing is available and easy to impliment
Alexandre Brisebois
Thanks :) for sharing your knowledge :)
anishmarokey
A: 

this is part of .Net 3.5 and is the same mechanism used by MVC

This makes your life easy, due to the fact that everything is held in the HttpContext.CurrentContext.Items[""]

I have adapted this code for a few project where I have an XML configuration file. I then use this file to build the RouteCollection. This code has also been easily extended to handle 301 redirects for SEO.

This method is also loaded once in your AppPool and removes the need to parse xml files and configurations for every call. This so far has been the best solution for me performance wise.

If you need any assistance please let me know. I will gladly lend a hand.

Alexandre Brisebois