Name
DataBinder
Synopsis
This class contains a single shared utility method, Eval(), which allows you to specify
data binding for controls like System.Web.UI.WebControls.DataList and System.Web.UI.WebControls.Repeater. The Eval() method accepts a string that
identifies a field in the control’s data source and uses it to retrieve the
corresponding information. For example, the statement <%# DataBinder.Eval(Container.DataItem, "Name") %> in a template for
a data control would retrieve data from the Name field of the control’s bound data
table. Note that you don’t need to use this method to create a data binding expression
(you can just use the <%# Container.DataItem("Name") %> syntax,
which is faster). However, using the DataBinder method gives you the chance to supply a
format string to configure date or numeric values.
Public NotInheritable Class DataBinder ' Public Constructors Public Sub New() ' Public Shared Methods Public Shared Function Eval(ByVal container As Object, ByVal expression As String) As Object Public Shared Function Eval(ByVal container As Object, ByVal expression As String, ByVal format As String) As String Public Shared Function GetIndexedPropertyValue( ByVal container As Object, ByVal expr As String) As Object Public Shared Function GetIndexedPropertyValue( ByVal container As Object, ByVal propName As String, ByVal format As String) As String Public Shared Function GetPropertyValue( ByVal container As Object, ByVal propName As String) As Object Public Shared Function ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access