Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear expert,


A Text box on a form with a Date calendar Extension.

On Selecting the date the return date should be in the form say

16 Dec 2014.


The date on the form is:: txt_Date_Disb.Text


How is the return date from the calendar like (i.e. the codes) ?

Thanks
Posted
Updated 4-Dec-14 23:44pm
v5
Comments
Thanks7872 5-Dec-14 5:07am    
Where is the code? What do you mean by date control?

Calendar control returns date as a DateTime value which you can then format in any way you want.

You can use DateTime object's ToString("dd MMM yyyy") method to get the format you asked for.
 
Share this answer
 
in the calander extender have property Format to assign a specific foramted date to textbox try it... Format="dd-MMMM-YY";

XML
<asp:CalendarExtender ID="txt_date_CalendarExtender" runat="server"
            Enabled="True" TargetControlID="txt_date" Format="yyyy-MM-dd">
        </asp:CalendarExtender>

it show date like 2014-12-05
 
Share this answer
 

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