Friday 23 January 2015

Format INR,Date inside gridview item template in asp.net

//HTML  INR

  <ItemTemplate>
   <asp:Label runat="server" ID="lbl_Amount" Text='<%#Eval("Amount","{0:#,##0.00;(#,##0.00)}") %>'></asp:Label>

   </ItemTemplate>


//.CS page

int Amt=122222.00

//Result

amt=1,22,222.00

--------------------------------------------------------


//HTML Date

//only for DD/MM/YYYY
  <ItemTemplate>
   <asp:Label runat="server" ID="lbl_date" Text='<%#Eval("Date","{0:dd/MM/yyyy}") %>'></asp:Label>

   </ItemTemplate>


//OR 
//only for hh:mm:ss
 <ItemTemplate>
   <asp:Label runat="server" ID="lbltime" Text='<%#Eval("Date","{0:hh:mm:ss}") %>'></asp:Label>

   </ItemTemplate>


//.CS page

datetime date=22/05/2015 05:10:30:000

//Result
1.
date=22/05/2015

2.
Time=05:10:30








No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...