Export (0) Print
Expand All

ValidationPropertyAttribute Constructor

Initializes a new instance of the ValidationPropertyAttribute class.

[Visual Basic]
Public Sub New( _
   ByVal name As String _
)
[C#]
public ValidationPropertyAttribute(
   string name
);
[C++]
public: ValidationPropertyAttribute(
   String* name
);
[JScript]
public function ValidationPropertyAttribute(
   name : String
);

Parameters

name
The name of the validation property.

Example

[Visual Basic] 
<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 

[C#] 
[ValidationPropertyAttribute("Message")]
public class MessageControl : Label
{
   private int _message = 0;
   public int Message
   {
      get 
      {
         return _message;
      }
      set
      {
         _message = value;
      }
   }
   
}

[C++] 
[ValidationPropertyAttribute(S"Message")]
public __gc class MessageControl : public Label
{
private:
   int _message;
public:
   __property int get_Message() 
   {
      return _message;
   }
   __property void set_Message( int value )
   {
      _message = value;
   }
};

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

ValidationPropertyAttribute Class | ValidationPropertyAttribute Members | System.Web.UI Namespace

Show:
© 2015 Microsoft