다음을 통해 공유


AnonymousIdentificationModule.Creating 이벤트

정의

새 익명 식별자를 만들 때 발생합니다.

public:
 event System::Web::Security::AnonymousIdentificationEventHandler ^ Creating;
public event System.Web.Security.AnonymousIdentificationEventHandler Creating;
member this.Creating : System.Web.Security.AnonymousIdentificationEventHandler 
Public Custom Event Creating As AnonymousIdentificationEventHandler 

이벤트 유형

예제

다음 코드 예제에서는 AnonymousIdentification_Creating 이벤트를 사용 하 여 사용자 지정 값으로 익명 식별자를 설정 합니다.

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

설명

이벤트는 Creating 이벤트 중에 발생합니다 PostAuthenticateRequest .

ASP.NET 애플리케이션의 AnonymousIdentificationModule Global.asax 파일에서 AnonymousIdentification_Creating이라는 서브루틴을 지정하여 클래스의 이벤트에 액세스할 Creating 수 있습니다.

AnonymousIdentification_Creating 이벤트에 제공된 개체의 AnonymousIdentificationEventArgs 속성을 사용하여 AnonymousID 익명 식별자를 사용자 지정 값으로 설정할 수 있습니다. AnonymousIdentification_Creating 이벤트 중에 속성 값을 AnonymousID 지정하지 않으면 a Guid 가 사용됩니다.

AnonymousIdentification_Creating 이벤트는 익명 식별이 있는 경우에만 발생합니다Enabled.

적용 대상