Assign today's date as "DefaultValue"

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I assign today's date as "DefaultValue"

<asp:ControlParameter ControlID="Calendar1" Name="DUEDATE"
PropertyName="SelectedDate" Type="DateTime" DefaultValue="TODAYs DATE" />
 
Hi,

There is not such a control in .net 1.1 where did you get it from?

In any case you could either use the code behind to set the DefaultValue:

void page_onload( ... )
{
if (!IsPostBack)
{
DUEDATE.DefaultValue = DateTime.Now.Date.ToString();
}

or using bindng:
<asp:ControlParameter ControlID="Calendar1" Name="DUEDATE"
PropertyName="SelectedDate" Type="DateTime" DefaultValue="<%#
DateTime.Now.Date.ToString()%>" />


cheers,
 
Back
Top