hello,
i am trying to achieve clean urls in my web application but have not been able to find a solution using the routing techniques discussed in this msdn link:
i would like all the edits to be in the Global.asax.vb file. when i use the following code, the url remains in its long form, unchanged.
Global.asax.vb:
Imports System.Web.Routing Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs) RegisterRoutes(RouteTable.Routes) End Sub Shared Sub RegisterRoutes(ByVal routes As RouteCollection) routes.MapPageRoute("Contact", "Products/Contact", "~/Products/ContactEntry.aspx") End Sub
this code runs with no errors, however, when i click on a link that uses the "~/Products/ContactEntry.aspx", the page loads and the url in the address bar remainshttp://<domain>/Products/ContactEntry.aspx. i was expecting to seehttp://<domain>/Products/Contact (a cleaner url).
am i missing something obvious?
thanks!