Live Chat Icon For mobile
Live Chat Icon

DataBinder.Eval imposes performance penalty on code as it uses late bound reflection. How can I replace this calls with explicit calls?

Platform: ASP.NET| Category: Controls

Change the Databinding Expression


<%#DataBinder.Eval (Container.DataItem , 'StartDate' , '{0:c}')%>

to

In VB.NET


<%#String.Format('{0:d}' , (CType(Container.DataItem, DataRowView))('StartDate'))%>

C#


<%#String.Format('{0:d}' , ((DataRowView)Container.DataItem)['StartDate'])%>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.