Obsidian Obsidian - 6 months ago 27
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
<%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "Date")).AddDays(1) %>
Comments