Reputation: 7201
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 advance!
EDIT:
Note that my URL with the Question Mark in it is reading a record from the DB with the ID of 112
Upvotes: 0
Views: 827
Reputation: 6743
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.
Upvotes: 0
Reputation: 11397
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
Upvotes: 0
Reputation: 9146
What you are talking about is called URL Rewriting, and Scott Guthrie has a handy article on this here.
Upvotes: 1