I have added this code to my global.asax
void Application_Start(object sender, EventArgs e)
{
RegisterRoutes(RouteTable.Routes);
}
.........
void RegisterRoutes(RouteCollection routes)
{
routes.RouteExistingFiles = true;
routes.MapPageRoute("Home", "Home", "~/Pages/Contents/Home.aspx");
}
And here's my web.config
="1.0"
<configuration>
<connectionStrings>
<add name="Test" connectionString="Data Source=DIZZY\SQLEXPRESS;Initial Catalog=VitaGamer;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False;"/>
</connectionStrings>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5" relaxedUrlToFileSystemMapping="true"/>
<pages controlRenderingCompatibilityVersion="4.0">
<controls>
<add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/>
</controls>
</pages>
</system.web>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="Default"/>
</files>
</defaultDocument>
<modules runAllManagedModulesForAllRequests="true"/>
<handlers>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit"/>
<remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit"/>
<remove name="ExtensionlessUrlHandler-Integrated-4.0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0"/>
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0"/>
</handlers>
</system.webServer>
</configuration>
So when I say http://localhost:42115/Home is supposed to show me http://localhost:42115/Pages/Contents/Home.aspx
But it's not. Instead it's showing me
HTTP Error 404.0 - Not Found on IIS 8.0 (express) Now I have another website with works pretty good with iis 8.0 but on this site routing is not working. Application pool is in integrated mode. It's not working with visual studio 2012 development sever either. But the other website does.