Szerkesztés

Megosztás a következőn keresztül:


RoleManagerEventArgs.Context Property

Definition

Gets the HttpContext for the current request.

public:
 property System::Web::HttpContext ^ Context { System::Web::HttpContext ^ get(); };
public System.Web.HttpContext Context { get; }
member this.Context : System.Web.HttpContext
Public ReadOnly Property Context As HttpContext

Property Value

The HttpContext for the current request.

Examples

The following example shows the GetRoles event included in the Global.asax file for an ASP.NET application. The GetRoles event adds a trace notification for an application where trace is enabled in the Web.config file.

public void RoleManager_OnGetRoles(object sender, RoleManagerEventArgs args)
{
  args.Context.Trace.Write("Roles", "Applying Role Information");
}
Public Sub RoleManager_OnGetRoles(sender As Object, args As RoleManagerEventArgs)
  args.Context.Trace.Write("Roles", "Applying Role Information")
End Sub

Remarks

The RoleManagerEventArgs object provides event information to the GetRoles event of the RoleManagerModule class. The Context property provides access to the HttpContext of the current request.

Applies to

See also