Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FormsAuthenticationEventArgs::User Property

 

Gets or sets the IPrincipal object to be associated with the current request.

Namespace:   System.Web.Security
Assembly:  System.Web (in System.Web.dll)

public:
property IPrincipal^ User {
	IPrincipal^ get();
	[SecurityPermissionAttribute(SecurityAction::Demand, ControlPrincipal = true)]
	void set(IPrincipal^ value);
}

Property Value

Type: System.Security.Principal::IPrincipal^

The IPrincipal object to be associated with the current request.

You can use the User property to set the User property of the current HttpContext to a custom IPrincipal object.

If you do not specify a value for the User property during the FormsAuthentication_OnAuthenticate event, the identity supplied by the forms authentication ticket in the cookie or URL is used.

The following example uses the FormsAuthentication_OnAuthenticate event to set the User property of the current HttpContext to a GenericPrincipal object with a custom Identity.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft