Victor Garcia Aprea [MVP]
1/9/2003 9:00:00 AM
Hi Jason,
The DefaultValue attribute is not meant to set the initial value of your
property, you should do so in for example, the class constructor.
--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
"Jason Butera" <jjbutera@hotmail.com> wrote in message
news:509b03ca.0301081426.6fca6ad4@posting.google.com...
> I want to have default values for my server control properties, but I
> can't seem to get them to work. My typical property set is like this:
>
> Dim m_Maximumvalue As Integer = 999999999
> <defaultvalue(999999999)> Public Property MaximumValue As Integer
> Get
> Return m_Maximumvalue
> End Get
> Set(ByVal Value As Integer)
> m_Maximumvalue = Value
> End Set
> End Property
>
> Unfortunately, this isn't working...why not?
>
> Also, how do you set the defaults for date datatypes, the following
> doesn't work?
> Dim m_Maximumvalue As Date = "12/31/9999"
> <defaultvalue("12/31/9999"))> Public Property MaximumValue As Date
> Get
> Return m_Maximumvalue
> End Get
> Set(ByVal Value As Date)
> m_Maximumvalue = Value
> End Set
> End Property
> ????????