Setting Default Value to a property on c#
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/691035/setting-the-default-value-of-a-datetime-property-to-datetime-now-inside-the-syst">Setting the default value of a DateTime Property to DateTime.Now inside the System.ComponentModel Default Value Attrbute</a>  </p>
</blockquote>



<p>Im creating a control like a calendar, and I want user to set de year they want to view.
But If they don't, the property of SelectedYear must be the actual year.</p>

<p>I try setting this Default Value like this:</p>

<pre><code>[DefaultValue(DateTime.Today.Year)]
public int SelectedYear{
    get{
        return _selYear;
    }
    set{
        _selYear = value;
        UpdateCalendar();
    }
}
</code></pre>

<p>And I got the following error</p>

<pre><code>An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type
</code></pre>
