ValidationPropertyAttribute.Name Właściwość

Definicja

Pobiera nazwę właściwości sprawdzania poprawności kontrolki serwera ASP.NET.

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

Wartość właściwości

String

Nazwa właściwości walidacji.

Przykłady

W poniższym przykładzie kodu pokazano użycie ValidationPropertyAttribute klasy podczas tworzenia kontrolki niestandardowej.

[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

Dotyczy