Home > Forum > ASP.NET Ajax > How to change ajax Calander Extender date format ?

How to change ajax Calander Extender date format ?

by Thamil   on Aug 13, 2013   Category: ASP.NET Ajax  |  Views: 3668    |  Points: 5   |  Gold 
  Reply

I have use Ajax Calander Extender I need dd/MM/yyyy in frnd end but back end date format stored in yyyy/MM/dd.and to show the grid view means date formt is dd/MM/yyyy Pls help me
am waiting
thanking you

Question posted on behalf of kirubaharan.

Bookmark and Share:
 
  User Reply  | Ask a question  |   Reply 
  Re :How to change ajax Calander Extender date format ?   
by Thamil
on Aug 13 2013 6:07AM
Points : 10
Gold 
Hello kirubaharan,

Please follow below sample code to change date format in calender extender control.

<ajaxtoolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxtoolkit:ToolkitScriptManager>
<asp:TextBox ID="datepicker" runat="server"></asp:TextBox>
<ajaxtoolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="datepicker" Format="dd/MM/yyyy"></ajaxtoolkit:CalendarExtender>
  Re :How to change ajax Calander Extender date format ?   
by angappan
on Dec 6 2013 10:52AM
Points : 10
Bronze 
hi Kirubaharan,

An Ajax Calender Extender you just change Format as "dd/MM/yyyy".

when you send data to db
string date=txtdate.text;
string sdate=txtdate.split("/")[2]+txtdate.split("/")[1]+txtdate.split("/")[0];
send sdate to db

or use date conversion method.

when get date on gridview

use like this format
'<%Bind("your db date column" ,"{0:dd/MM/yyyy}" %>'


I hope this is useful to you.

Thanks and Regards
Angappan.S

Recent Post

Latest Posts