I seem to be having an issue with either namespacing or Registration. At this point, I am leaning more towards area and registration issues with MVC 3.0, but I am open to any ideas here.
My CAPAreaRegistration.cs file looks ike this:
namespace CISE.CINet.UserInterface.Areas.CAP
{
public class CAPAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "CAP";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"CAP_default",
"CAP/{controller}/{action}/{id}",
new { action = "NewNomination", id = UrlParameter.Optional }
);
}
}
}
I have also tried adding the namespace i changed everything to:
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"CAP_default",
"CAP/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional }, new string[] { "CISE.CINet.UserInterface.Areas.CAP.Controllers" } // specify the new namespace
);
}
The Global.asax looks like this:
namespace CISE.CINet.UserInterface
{
// Note: For instructions on enabling IIS6 or IIS7 classic mode,
// visit http://go.microsoft.com/?LinkId=9394801
public class MvcApplication : System.Web.HttpApplication
{
#region PUBLIC FIELDS TO ALL APPLICATIONS
//public static string SERVER_NAME = "ri-cinet-prd";
public static string SERVER_NAME = "se-cinet-dev";
public static string SHAREPOINT_PATH = "http://se-spoint-dev/";
#endregion
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
{
filters.Add(new HandleErrorAttribute());
}
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"CAPLogin",
"CAP/WelcomePartial",
new { controller = "Home", action = "WelcomePartial", id = UrlParameter.Optional }
);
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
}
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
RegisterGlobalFilters(GlobalFilters.Filters);
RegisterRoutes(RouteTable.Routes);
}
}
The Home Controller works, but trying to go to CAP/NewNomination or CAP/Index does not work? I am getting a 404 error:
Any ideas? Is my URL path incorrect?