neophyte
5
Q:

how to set the current user httpcontext.current.user asp.net -mvc

String[] newRoles = { "Administrator", "Customer" };
GenericIdentity newIdentity = new GenericIdentity(model.AccountName);
GenericPrincipal newPrincipal = new GenericPrincipal(newIdentity, newRoles);                       
System.Web.HttpContext.Current.User = newPrincipal;  
-1

New to Communities?

Join the community