Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
フォーム認証を使用するアカウント コントローラーで、デフォルトの ASP.NET MVC 4 プロジェクトを使用しています。現在のユーザーのユーザー ID を取得するにはどうすればよいですか? ビューに表示したい。
次のコードを使用できます。
MembershipUser user = Membership.GetUser(User.Identity.Name);
ありがとう、スティーブ