Getting the logged in username in ASP.NET MVC3 intranet application
I am working on a MVC 3 intranet application ( windows authentication ). The application must display the profile page of the user once a user logs in. In order to do that the username of the logged in user must be passed in as a route parameter in the following route in Global.asax.cs. routes.MapRoute( "Initial", "{controller}/{action}/{emailAlias}", // URL with parameters new { controller = "Home", action = "Home", userId = **<USERNAME>**} ); Here, for the I've used some alternatives. At first I used Environment.Username . Which works well in development. But not after publishing. Because