ValidatingPropertiesEventArgs 클래스

정의

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

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

예제

다음 예제에서는 이벤트에 대한 이벤트 처리기를 보여 있습니다 ValidatingProperties . 속성에 전달된 FirstName 값이 비어 있거나 null컬렉션에 FirstName 속성이 추가 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 실패한 속성을 확인할 수 있도록 속성의 컬렉션을 반환합니다.

속성

Name Description
FailedProperties

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

Properties

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

메서드

Name Description
Equals(Object)

지정한 개체와 현재 개체가 같은지 여부를 확인합니다.

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

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

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

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

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

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

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

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

(다음에서 상속됨 Object)

적용 대상