开发者

MVC obtaining active directory user name

How do you obtain the username of the logged in user with MVC2 in ASP.NET web forms I used to do it with:

User.Identity.Name

This works when I am te开发者_StackOverflow中文版sting on my local machine using visual studio but no longer works once the project is published to the test server.

Thanks


This turned out to be a setting on the Virtual Directory. The option "enable anonymous access" was selected. Once this was de-selected everything worked as expected.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜