DreamTeK
DreamTeK

Reputation: 34177

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.

Upvotes: 0

Views: 226

Answers (1)

Kahbazi
Kahbazi

Reputation: 14995

<%# Convert.ToDateTime(DataBinder.Eval(Container.DataItem, "Date")).AddDays(1) %>

Upvotes: 1

Related Questions