ValidatingPropertiesEventArgs.FailedProperties 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
유효성 검사에 실패한 프로필 속성을 포함하는 컬렉션을 가져옵니다.
public:
property System::Collections::ObjectModel::Collection<System::String ^> ^ FailedProperties { System::Collections::ObjectModel::Collection<System::String ^> ^ get(); };
public System.Collections.ObjectModel.Collection<string> FailedProperties { get; }
member this.FailedProperties : System.Collections.ObjectModel.Collection<string>
Public ReadOnly Property FailedProperties As Collection(Of String)
속성 값
유효성 검사에 실패한 프로필 속성입니다.
예제
다음 예제에서는 이벤트 처리기는 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
설명
FailedProperties 속성 유효성 검사에 실패 하는 속성의 이름 컬렉션을 포함 합니다. 에 대 한 이벤트 처리기를 만드는 경우는 ValidatingProperties 컬렉션에 유효성 검사를 실패 하는 속성의 이름을 추가 이벤트는 FailedProperties 속성입니다. SetPropertiesForCurrentUser 의 컬렉션을 반환 하는 메서드는 FailedProperties 속성 유효성 검사에 실패 한 속성을 확인할 수 있도록 합니다.
적용 대상
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET