2017-05-31 76 views
-1

我有以下代碼,我希望每當用戶點擊他/她的名字時,它會打開一個管理帳戶頁面。ASP.net意外的錯誤404

@Html.ActionLink("Hello " + User.Identity.Name + "" ,"Manage", "Account" ,routeValues: null, htmlAttributes: new { title = "Manage" }) 

然而,儘管我已經創建了一個Manage.cshtml的看法,我仍然收到錯誤404 enter image description here

+5

你創造AccountController上的ActionResult返回視圖? –

回答

1

你需要創建一個動作到控制器中

public ActionResult Manage() 
{ 
    return View(); 
} 
+0

非常感謝,它的工作。但由於某種原因,我的管理視圖是空的,雖然我有數據,你可能知道爲什麼? 這裏是我的代碼:https://gist.github.com/anonymous/6ecb6d748fdaf9307fa182a985a71787 –

+0

你需要返回你的模型來填寫你的表格 return View(employeeModel); –

+0

Employee employee = db.Employees.Find(id); return View(employee); 所以我寫了這段代碼,但仍然沒有。有什麼建議麼? –