I have a controller that gets data based on current user that is logged in. And I would like to assign a local variable like this:
public UsergroupsCustAdminController()
{
User u = _us.GetUsers(HttpContext.User.Identity.Name).First();
this._customerID = u.CustomerID;
}
Somehow I cant get the value for current user logged in. How should I fix this? I need to use that “CustomerID” in lots of places in my controllerclass.
/M
found answer on:
http://weblogs.asp.net/rashid/archive/2009/04/01/asp-net-mvc-best-practices-part-1.aspx