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

How to highlight selected text in notepad++

  –> To highlight a block of code in Notepad++, please do the following steps step-1  :- Select the required text. step-2  :- Right click...