Click here to Skip to main content
15,897,093 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hey every one this is my code
<string.Format("{0:dd-mmm-yyyy}", DataBinder.Eval(Container.DataItem, "DateOfRate", "{0:dd-mmm-yyyy}"))

this code give date this format 01/12/2012
but i want date this format 01-dec-2013
how to do this.. this code not fullfil my requirment please help me....
Posted

Check msdn online or offline by yourself!
I searched two urls for you,as follows:

http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx[^]

http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[^]

If you still hava question,please send message to me !
 
Share this answer
 
You can do this simply as
C#
<%# DataBinder.Eval(Container.DataItem, "DateOfRate", "{0:dd-MMM-yyyy}") %>

C#
<asp:Label id="Date" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "DateOfRate", "{0:dd-MMM-yyyy}") %>'</label>

Regards..:laugh:
 
Share this answer
 
v4
Comments
Arsalaan Ahmed 25-Jul-13 2:05am    
Not working.......
Thanks7872 25-Jul-13 2:11am    
Refer to updated answer.Tested and working.
Arsalaan Ahmed 25-Jul-13 2:16am    
both not working......
:(
Arsalaan Ahmed 25-Jul-13 2:19am    
yes....
Sushil Mate 25-Jul-13 2:28am    
what is not working. cant you debug.

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