ValidatingPropertiesEventArgs 클래스

정의

ValidatingProperties 이벤트에 대한 데이터를 제공합니다.

public ref class ValidatingPropertiesEventArgs : EventArgs
public class ValidatingPropertiesEventArgs : EventArgs
type ValidatingPropertiesEventArgs = class
    inherit EventArgs
Public Class ValidatingPropertiesEventArgs
Inherits EventArgs
상속
ValidatingPropertiesEventArgs

예제

다음 예제에서는 이벤트 처리기는 ValidatingProperties 이벤트입니다. 에 대 한 값을 전달 하는 경우 FirstName 속성이 비어 또는 nullFirstName 속성을 추가 합니다 FailedProperties 컬렉션입니다.

void Application_Start(object sender, EventArgs e) 
{
    System.Web.ApplicationServices.ProfileService.ValidatingProperties += new EventHandler<System.Web.ApplicationServices.ValidatingPropertiesEventArgs>(ProfileService_ValidatingProperties);
}

void ProfileService_ValidatingProperties(object sender, System.Web.ApplicationServices.ValidatingPropertiesEventArgs e)
{
    if (String.IsNullOrEmpty((string)e.Properties["FirstName"]))
    {
        e.FailedProperties.Add("FirstName");
    }
}
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
    AddHandler System.Web.ApplicationServices.ProfileService.ValidatingProperties, _
      AddressOf ProfileService_ValidatingProperties
End Sub

Sub ProfileService_ValidatingProperties(ByVal sender As Object, ByVal e As System.Web.ApplicationServices.ValidatingPropertiesEventArgs)
    If (String.IsNullOrEmpty(CType(e.Properties("FirstName"), String))) Then
        e.FailedProperties.Add("FirstName")
    End If
End Sub

설명

에 대 한 이벤트 처리기를 만들기는 ValidatingProperties 프로필 속성 값의 유효성을 검사 하는 방법을 사용자 지정 하는 이벤트입니다. ValidatingProperties 사용자에 대 한 프로필 속성이 설정 될 때 이벤트가 발생 합니다. 유효성 검사에 실패 하는 속성 값의 컬렉션에 추가 된 FailedProperties 속성입니다. SetPropertiesForCurrentUser 의 컬렉션을 반환 하는 메서드는 FailedProperties 속성 유효성 검사에 실패 한 속성을 확인할 수 있도록 합니다.

속성

FailedProperties

유효성 검사에 실패한 프로필 속성을 포함하는 컬렉션을 가져옵니다.

Properties

유효성을 검사할 프로필 속성에 대한 이름과 값의 컬렉션을 가져옵니다.

메서드

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

적용 대상