Ok, so this one is sending me a little "loopy". I know I'm new to MVC but blimey this is a pain.
Basically all I'm trying to do is set "override'able" action methods in my Controller using RouteAttrbitues which in turns throws the 403.
I'm hoping to get pushed in the right direction. Thanks in advance!
Config
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapMvcAttributeRoutes();
routes.RouteExistingFiles = true;
}
Controller
[RoutePrefix("CMSPage")]
public class CMSPageController : Controller
{
private IEntityRepository<Type> _entityRepo;
[HttpGet]
[Route("", Name = "Home")]
public ActionResult Index()
{
//var model = entityRepo.FindByName("Home");
return Index();
}
[HttpGet]
[Route("{topLevelPageName}", Name = "TopLevelPage")]
public ActionResult Index(string topLevelPageName)
{
//var model = entityRepo.FindByName(name);
return Index(topLevelPageName);
}
[HttpGet]
[Route("{topLevelPageName}/{pageName}", Name = "PageName")]
public ActionResult Index(string topLevelPageName, string pageName)
{
//var model = entityRepo.FindByName(name);
return Index(topLevelPageName, pageName);
}
}
This code is pretty basic and I'm almost fairly certain I'm missing something silly.
A nudge in the right direction will be of great help!
Regards,