ValidationPropertyAttribute(String) コンストラクター

定義

ValidationPropertyAttribute クラスの新しいインスタンスを初期化します。

public:
 ValidationPropertyAttribute(System::String ^ name);
public ValidationPropertyAttribute (string name);
new System.Web.UI.ValidationPropertyAttribute : string -> System.Web.UI.ValidationPropertyAttribute
Public Sub New (name As String)

パラメーター

name
String

検証プロパティの名前。

次のコード例は、カスタム コントロールを ValidationPropertyAttribute 作成するときにクラスを使用する方法を示しています。

[ValidationPropertyAttribute("Message")]
public class MessageControl : Label
{
   private int _message = 0;
   public int Message
   {
      get 
      {
         return _message;
      }
      set
      {
         _message = value;
      }
   }
}
<ValidationPropertyAttribute("Message")> Public Class MessageControl
   Inherits Label
   Private _message As Integer = 0

   Public Property Message() As Integer
      Get
         Return _message
      End Get
      Set(ByVal Value As Integer)
         _message = Value
      End Set
   End Property
End Class

適用対象