0
我收到此錯誤:錯誤使用[授權]
The following sections have been defined but have not been rendered for the layout page "~/Views/Shared/_Layout.cshtml": "Scripts".
我只當我把[授權]家用控制器上出現此錯誤。
[Authorize]
public ViewResult Index()
{
return View();
}
麻煩拍攝,我已經去除了所有的_layout頁面,但這樣的:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="container body-content">
@RenderBody()
</div>
</body>
</html>
而對於家庭的索引視圖無非是這樣的:
hello world
如果我刪除[授權],那麼沒有錯誤。
這樣做了!當它讓我時,我會標記爲答案。 –
奇怪的是'[Authorize]'屬性影響了這個,除非我有什麼東西丟失了。 –
它不應該。我懷疑還有另一個像/帳戶/登錄先呈現的視圖。 – Francisco