Using Page.User.Identity.Name in MVC3

后端 未结 3 1951
清歌不尽
清歌不尽 2021-01-04 00:47

In MVC2 I have used Page.User.Identity.Name using the <%@ Control Language=\"C#\" Inherits=\"System.Web.Mvc.ViewUserControl\" %>

How

3条回答
  •  轮回少年
    2021-01-04 01:26

    I had the same problem. I used this tutorial to solve this issue.

    In short, in your view, put this code:

    @Context.User.Identity.Name
    

    Just make sure that the project is set to authenticate with windows.

提交回复
热议问题