Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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;  
Source by www.codeproject.com #
 
PREVIOUS NEXT
Tagged: #set #current #user
ADD COMMENT
Topic
Name
4+9 =