Click here to Skip to main content
15,908,112 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
ASP.NET
 <asp:TemplateField Visible="true">
<ItemTemplate>
<span class="time">
<p class="time_exact">
<asp:Label runat="server" Text='<%# Bind("arrivalTime") %>' ID="Label5"></asp:Label>
</p>
</span>
</ItemTemplate>
<ItemStyle Width="200px" HorizontalAlign="Left" CssClass="customerProductItemTemp gridviewLeftMargin" />
</asp:TemplateField>


What I have tried:

i am getting arriveltime in munutes example 990
i need to covert minutes by using 990/60.
i need conversion logic
Posted
Updated 26-May-16 3:35am

ASP.NET
<asp:TextBox ID="txtDate" runat="server" Text='<%# Convert.ToDateTime(Eval("dateTime")).ToString("d") %>'></asp:TextBox>
 
Share this answer
 
Comments
siva Prasad Paruchuri 26-May-16 9:33am    
i am getting null.
try this
Create a method in code behind to get the minutes from seconds
C#
public string GetMinutes(object value)
        {
            double mins ;
            double.TryParse(value.ToString(), out mins);
            mins = mins / 60;
            return mins.ToString();
        }


change your mark up as
ASP.NET
<asp:Label runat="server" Text='<%#  GetMinutes( Eval("arrivalTime")) %>' ID="Label5"></asp:Label>
 
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