0
我有一個包含區域的基本項目,我已在此區域註冊了我的路線並使用了小寫的URL擴展名。下面是代碼:C#MVC 4,區域路線,使用主視圖?
using System.Web.Mvc;
using Web.Modules;
namespace Web.Areas.Services
{
public class ServicesAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Services";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRouteLowercase(
"Services", // Route name
"services/{controller}/{action}/{id}", // URL with parameters
new { controller = "Services", action = "Index", id = UrlParameter.Optional }, // Parameter defaults
new string[] { "Web.Areas.Services" }
);
}
}
}
但現在,當我去http://localhost/services/home
它讓我看到我的HomeController的索引視圖,我能做些什麼來解決這個問題?我已經添加了命名空間並將該區域添加到路由數據。
感謝您的任何援助