Oct 23, 2009 03:07 AM|rat170|LINK
Currently I have a URL structure like when someone opens www.mysite.com/default.aspx?pid=50 then it searches for the pid 50 in the database pulls out the corresponding data against pid = 50 then displays the page according to the pulled data, and by looking
at URLs no one can ever get an idea of the contents of that page. I want that whenever user open an link like www.mysite.com/default.aspx?pid=50 then it should pull out the title entry against the pid = 50 and then transform it into lower letters and then
add underscores instead of space, which I will do by using this simple code
Dim lowerstring As String
Dim lowerstringwus As String
lowerstring = realtitle.tolower() 'realtitle is the title entry against the specified pid
lowerstringwus = lowerstring.Replace(" ", "_")
Then the URL should look like www.mysite.com/detail/<title>.aspx
Further when user enters the same URL as above then the same page should open, so that bookmarks may not be get wasted.
I read somewhere to use URLrewriter.net
<rewrite url="~/products/books.aspx" to="~/products.aspx?category=books" />
<rewrite url="~/products/CDs.aspx" to="~/products.aspx?category=CDs" />
<rewrite url="~/products/DVDs.aspx" to="~/products.aspx?category=DVDs" />
But I have lots and lots of pages, so it becomes useless.