任何想法爲什麼找不到此鏈接?未找到MVC3路由
context.MapRoute(null, "Admin/CompanyUserDelete/{userprofileid}", new { controller = "Admin", action = "CompanyUserDelete", userprofileid = UrlParameter.Optional });
它使用AreaRegistration類定義。
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "Admin";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(null, "Admin", new { controller = "Admin", action = "Index" });
context.MapRoute(null, "Admin/Users", new { controller = "Admin", action = "CompanyUsers" });
context.MapRoute(null, "Admin/Users/Create", new { controller = "Admin", action = "CreateUser" });
context.MapRoute(null, "Admin/Users/{userprofileid}", new { controller = "Admin", action = "CompanyUser" });
context.MapRoute(null, "Admin/CompanyUserDelete/{userprofileid}", new { controller = "Admin", action = "CompanyUserDelete", userprofileid = UrlParameter.Optional });
context.MapRoute(null, "Admin/Users/{userprofileid}/Photo", new { contro
ller = "Admin", action = "UserImage" });
}
</code></pre>
這裏是未找到鏈接。
@Html.ActionLink("Delete", "CompanyUserDelete", "Admin", new { area = "Admin", userprofileid = userItem.UserProfileId }, null)
你忘了展現尤其哪一個環節沒有找到。您只顯示您的管理區域路線定義。 –
謝謝。我更新了消息。 – Keith