Data Binding
There are 3 different ways to do data binding within the data view. These can be set as part of the template:
- <%# Eval(…) %> - Merely writes it out, as is. The is the default when you convert to template
- <%# Bind(…) %> - Can be used to write it out and can do post it back in the edit scenario, allowing us to update the database
- <%# XPath(…) %> - used with XML datasource. To supply a XPath string so that we can query the XML to get the data suing an Xpath expression.
Example:
<%# Eval(“FieldName”) %>
The <%# represent a databinding expression, the example above allows you to write out the value of a field that the database has.
Comments