I have a controller and want to define default route on it, like as follow:
public class SignInController : Controller
{
[Route("", Name = "Default")]
public ActionResult Index()
{
return View();
}
}
on the RoutingConfig
I comment out MapRoute
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
/*routes.MapRoute("Default", "{controller}/{action}/{id}",
new {controller = "SignIn", action = "Index", id = UrlParameter.Optional}
);*/
}
When I start to server, I've got:
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
What am I doing wrong?