2016-02-11 49 views
-1

我正在嘗試爲我的管理區域創建索引頁面,但我對此一無所知,試圖進行搜索但未找到任何解決方案。如何製作區域[ASP MVC]的索引頁面

這裏是我區的圖片:

enter image description here

只要我要讓我的面積指數是這樣的:

http://localhost/admin 

,我會定製塔索引頁面牛逼路徑...

感謝

+0

只需添加一個'HomeController的'。 –

回答

0

你可以用內返回你想查看一個指數操作添加HomeController的。

或者,假設你的默認操作在現有的控制器的一個定義,在註冊時的區域(例如,在BooksController中一個索引行動)只是將它加入:

public override void RegisterArea(AreaRegistrationContext context){ 
    context.MapRoute(
     name: "Default", 
     url: "{controller}/{action}/{id}", 
     defaults: new 
     { 
      area = "Admin", 
      controller = "Books", 
      action = "Index", 
      id = UrlParameter.Optional 
     }); 
}