ASP.. NET data binding must be activated once specified. You can use the DataBind method to activate it. Note that the DataBind method must be called in the Load event; otherwise, ASP.. NET will ignore the data binding expression and display it as a null value on the page
There are two types of data binding in ASP. NET: Single-value binding and multi-value binding.
What they have in common: they do not need to work with ADO. NET at the same time.
Differences: Single-value binding can dynamically insert a variable, attribute, or expression into a page to help create a data control template.
Multi-value binding can display the content used by a table. It must support its special control (including the DataSource attribute)
Single value binding:
There are four common expressions:
<% = XX %>, inline mode, can reference C # code
<% # XXX %>, referencing the code field in the. cs File
<% # $ Xxx %>, referencing pre-defined fields or registered classes in the web. config file
<% # Eval (xxx) %>. You need to bind the data source.
All Rights Reserved: jory-able to withstand torture and loneliness
From jory