ログイン部分を取得して、データベースからユーザーの姓名を読み取ろうとしています。したがって、ビューのパーシャルではなく、レイアウトからアクションを呼び出そうとしています。
@If Request.IsAuthenticated Then
@<text><div class="authBox">Welcome <strong>@User.Identity.Name</strong>!
</div></text>
Else
レイアウトのこの行でスタック オーバーフロー例外が発生しています。
@Html.Action("RenderLogOnPartial", "Employee")
これが私が呼んでいるアクションです:
'
' GET: /Employee/RenderLogOnPartial
Public Function RenderLogOnPartial() As ViewResult
Return View("_LogOnWithValidationPartial")
End Function
ビューのパーシャルに姓名を取得するにはどうすればよいですか? ありがとう。