RoleManagerEventArgs.Context Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
HttpContext Mendapatkan untuk permintaan saat ini.
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
Nilai Properti
HttpContext untuk permintaan saat ini.
Contoh
Contoh berikut menunjukkan peristiwa yang GetRoles disertakan dalam file Global.asax untuk aplikasi ASP.NET. Peristiwa menambahkan GetRoles pemberitahuan pelacakan untuk aplikasi di mana jejak diaktifkan dalam file Web.config.
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
Keterangan
Objek RoleManagerEventArgs menyediakan informasi peristiwa untuk GetRoles peristiwa RoleManagerModule kelas. Properti Context menyediakan akses ke HttpContext permintaan saat ini.