I have installed Microsoft.AspNet.FriendlyUrls
and it has installed successfully. I have also added Global.asax
and added following two methods in this file:
protected void Application_Start(object sender, EventArgs e)
{
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.EnableFriendlyUrls();
}
I have Default page in my project which has User Control which is inside folder. Like:
==>UserControlsSite
===>ctrl_Login
I have made the URL like Default/site/010001
and getting segments like this at control's page load:
string strLevel = "";
foreach (var segment in Request.GetFriendlyUrlSegments())
{
strLevel = segment.ToString();
}
This URL is working fine Default/site/010001
But When I try to load Default.aspx
it gives HTTP Error 403.14
and URL
becomes Default/
I have tried this in web.Config
but of no use :
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
I have also cross check this:
In "Turn Windows Features on or off", under Internet Information Services -> World Wide Web Services -> Application Development Features, .NET Extensibility 3.5, .NET Extesibility 4.5, ASP.NET 3.5, ASP.NET 4.5, ISAPI Extensions, and ISAPI
Filters are SELECTED.
I have also tried this with no use:
cd \
cd Windows\Microsoft .NET\Framework\v4.xxx.xxx
aspnet_regiis -i