Share via


ValidationPropertyAttribute.Name プロパティ

定義

ASP.NET サーバー コントロールの検証プロパティの名前を取得します。

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

プロパティ値

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

適用対象