I have a folder structure like this:
www.mysite.com/About/About.aspx
I have a link in a user control like this:
<a href="~/About/About" id="aboutLink" title="About" runat="server">About</a>
And in my RegisterRoutes() method, I have this:
routes.MapPageRoute("", "About/About/", "~/About/About.aspx");
It works but produces the following URL:
www.mysite.com/About/About
What I would like is this:
www.mysite.com/About
Is this possible with out-of-the-box 4.0 routing?
UPDATE 2 - 05-14-2010:
Apparently, I introduced an extra issue by naming the .aspx Web Form the same as the containing folder. Finally, this is what worked for me:
RouteTable.Routes.MapPageRoute("", "About/", "~/AboutUs/About.aspx");
<asp:HyperLink ID="aboutLink" NavigateUrl="~/About"
Text="About" runat="server"></asp:HyperLink>
The links provided by Raj helped me find the answer :-)
http://msdn.microsoft.com/en-us/library/cc668201.aspx