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 特定できるように、プロパティ内のコレクションを返します。

プロパティ

FailedProperties

妥当性確認に失敗したプロファイル プロパティを含むコレクションを取得します。

Properties

妥当性を確認するプロファイル プロパティの名前と値のコレクションを取得します。

メソッド

Equals(Object)

指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Object の簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象