This entry is directly related to: MVC5 scope not working
This article fixed the index.cshtml problem, however, it did not allow every view for this controller. For instance:
http://localhost:45970/Setup/Start gives an error that the resource cannot be found (basically, 404).
However, it http://localhost:45970/Setup/Setup/Startdisplays the correct page.
So, what needs to be reconfigured so that ALL views for this controller in the settings area are opened correctly?
Change 1
Code from SetupAreaRegistration.cs
using System.Web.Mvc;
namespace BlocqueStore_Web.Areas.Setup
{
public class SetupAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Setup";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
name: "Setup_default",
url: "Setup/{controller}/{action}/{id}",
defaults: new { action = "Index", controller = "Setup", id = UrlParameter.Optional },
namespaces: new[] { "BlocqueStore_Web.Areas.Setup.Controllers" }
);
}
}
}
source
share