ASP.NET 4.0 Routing and Subfolders

Posted by IrishChieftain on Stack Overflow See other posts from Stack Overflow or by IrishChieftain
Published on 2010-05-14T01:19:33Z Indexed on 2010/05/14 1:24 UTC
Read the original article Hit count: 362

I have a folder structure like this:

Site/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:

Site/About/About

What I would like is this:

Site/About

Is this possible with out-of-the-box 4.0 routing?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-4.0