Search code examples
c#asp.netajaxcontroltoolkitcalendarextender

How can I make CalendarExtender StartDate attribute take the current date?


I thought something like this

<ajaxToolkit:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" 
            TargetControlID="txtDatumPoaganje" Format="MM/dd/yyyy" StartDate=<%=DateTime.Now%>>

But it doesnt work. I can make something similar with JavaScript and alert message:

how to disable previous dates in CalendarExtender control through its render event?

but it's not the same.


Solution

  • Try SelectedDate instead of StartDate.

    Also, the link below says you can't set selecteddate from the html side, instead you must do it from code-behind.

    I haven't confirm this however. http://forums.asp.net/t/1293771.aspx/1