Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
i have one Ajax CalendarExtender associated with a text box..
<asp:TextBox ID="txtFromDate" runat="server" CssClass="inp-form" EnableViewState ="false" />

<asp:CalendarExtender ID="CalendarExtenderFromDate" OnClientDateSelectionChanged="CloseCalenderUI"
                               runat="server" TargetControlID="txtFromDate" Format="MM/dd/yyyy" EnableViewState ="false">
                           </asp:CalendarExtender>

i select a date like '01/25/2012' and manually change it to '01/25/1111'
by java script validation i clear the value od text box to ''
When i again click txt box the calender show year as 1111 i want calender show current date..
Posted

Hi
Try the following

XML
<asp:CalendarExtender ID="CalendarExtenderFromDate" OnClientDateSelectionChanged="CloseCalenderUI"
                                runat="server" TargetControlID="txtFromDate" Format="MM/dd/yyyy" EnableViewState ="false" SelectedDate='<%#System.DateTime.Now%>'
                            </asp:CalendarExtender>


Hope this helps
 
Share this answer
 
Comments
amit sahu20 10-Jan-12 3:40am    
not working
Set
C#
CalendarExtender1.SelectedDate = DateTime.Now.Date

in your load page to set the calendar date .
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900