Freigeben über


AnonymousIdentificationEventHandler Delegat

Definition

Stellt die Methode dar, die das AnonymousIdentification_Creating Ereignis eines .AnonymousIdentificationModule

public delegate void AnonymousIdentificationEventHandler(System::Object ^ sender, AnonymousIdentificationEventArgs ^ e);
public delegate void AnonymousIdentificationEventHandler(object sender, AnonymousIdentificationEventArgs e);
type AnonymousIdentificationEventHandler = delegate of obj * AnonymousIdentificationEventArgs -> unit
Public Delegate Sub AnonymousIdentificationEventHandler(sender As Object, e As AnonymousIdentificationEventArgs)

Parameter

sender
Object

Die Quelle des Ereignisses.

e
AnonymousIdentificationEventArgs

Ein AnonymousIdentificationEventArgs Objekt, das die Ereignisdaten enthält.

Beispiele

Im folgenden Codebeispiel wird das AnonymousIdentification_Creating-Ereignis verwendet, um den anonymen Bezeichner auf einen benutzerdefinierten Wert festzulegen.

public void AnonymousIdentification_Creating(object sender, 
                                             AnonymousIdentificationEventArgs args)
{
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId();
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousID);
}
Public Sub AnonymousIdentification_Creating(sender As Object,  _
                                            args As AnonymousIdentificationEventArgs)
  args.AnonymousID = Samples.AspNet.Security.MyIdClass.GetAnonymousId()
  Samples.AspNet.Security.MyIdClass.LogAnonymousId(args.AnonymousId)
End Sub

Hinweise

Der Delegat AnonymousIdentificationEventHandler wird für das Creating Ereignis der AnonymousIdentificationModule Klasse definiert. Sie können auf das Creating Ereignis der AnonymousIdentificationModule Klasse zugreifen, indem Sie eine Unterroutine namens AnonymousIdentification_Creating in der Datei "Global.asax" für Ihre ASP.NET Anwendung angeben. Das Creating Ereignis wird während des Ereignisses PostAuthenticateRequest ausgelöst.

Das AnonymousIdentificationModule Konstrukt eines AnonymousIdentificationEventArgs Objekts mithilfe des aktuellen HttpContext Objekts und übergibt es an das AnonymousIdentification_Creating-Ereignis .

Sie können die AnonymousID Eigenschaft des Objekts verwenden, das AnonymousIdentificationEventArgs für das AnonymousIdentification_Creating-Ereignis bereitgestellt wird, um den anonymen Bezeichner auf einen benutzerdefinierten Wert festzulegen. Wenn Sie während des AnonymousIdentification_Creating-Ereignisses keinen Wert für die AnonymousID Eigenschaft angeben, wird ein Guid Wert verwendet.

Das AnonymousIdentification_Creating-Ereignis wird nur ausgelöst, wenn die anonyme Identifikation durch Enabled Festlegen des <anonymousIdentification-Konfigurationselements> auf true.

Erweiterungsmethoden

Name Beschreibung
GetMethodInfo(Delegate)

Ruft ein Objekt ab, das die vom angegebenen Delegaten dargestellte Methode darstellt.

Gilt für: