4
大多數行動項目的控制器簡單的返回相應的視圖:辦法擺脫,只是在ASP.NET MVC返回視圖控制器GET-行動
public ActionResult Index()
{
return View();
}
我不知道有沒有什麼方法來擺脫這種GET操作和地圖url直接查看? 例如: '/家/索引' 呈現視圖 '〜/查看/主頁/ Index.cshtml' 的溶液
示例代碼由哈伊姆Brykman建議(@ haim770):https://github.com/artplastika/ViewWithoutControllerDemo
這將給404沒有代碼實際控制器類與指定的行動。 – artplastika 2014-10-30 12:12:53
你試過了嗎? – haim770 2014-10-30 12:15:48
當然!你呢?) – artplastika 2014-10-30 12:17:03