How can I use the CalendarExtender StartDate attribute for 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 that does not work. I can do something similar with JavaScript and a warning message:

How to disable previous dates in a CalendarExtender control through its rendering event?

but it’s not the same.

+4
source share
3 answers

Try SelectedDate instead of StartDate.

In addition, the link below says that you cannot set selecteddate from the html side, you should do it from the code instead.

However, I did not confirm this. http://forums.asp.net/t/1293771.aspx/1

+3
source

you can put this on the download page

TextBox2_CalendarExtender.StartDate = DateTime.Now.Date;

+2
source

Assuming you're only trying to show dates from DateTime.Now , this might help you: Disable previous dates in ajaxToolkit CalendarExtender

0
source

Source: https://habr.com/ru/post/1391001/


All Articles