Obsidian Obsidian - 2 years ago 123
Vb.net Question

Add days to a dataitem date field in ASP.NET

How to increment a single day from a dataitem bound to a Gridview TemplateField?

<%# DataBinder.Eval(Container.DataItem, "Date")%>


RESULT

13/05/16

DESIRED RESULT

14/05/16

I am trying to achieve this on the aspx page and not from code behind.

Answer Source
<%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "Date")).AddDays(1) %>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download