I have a site using webforms with framework 4.0. I am trying to get url rewriting to work locally. My local root appeas as follows: http://localhost:8241/sitename.com
When I go to http://localhost:8241/sitename.com/folder1/170/ I get a 'The resource cannot be found' page.
Here is my Global.asax code:
Code:
<%@ Application Language="VB" %>
<%@ Import Namespace="System.Web.Routing" %>
<%@ Import Namespace="System.Security.Principal" %>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
RegisterRoutes(RouteTable.Routes)
End Sub
'..... other subs here removed
Sub RegisterRoutes(ByVal routes As RouteCollection)
routes.MapPageRoute("user-detail", _
"folder1/{userid}/", _
"~/folder1/user-detail.aspx")
End Sub
</script>
The page I want executed is and does exist:
/folder1/user-detail.aspx
Control Panel > Programs > Programs and Features has IIS 8.0 Express
Visual Studio 2010 > Tools > Options > Projects and Solutions > Web Projects has 'Use IIS Express for new file-based web sites and projects' is checked.
Any ideas on how locally I can get url rewriting to work?
Thanks.