ASP.NET 4.5 introduces strongly typed data controls.
From what I could gather there are two options how to access the data item
<%# Item %>
and
<%# BindItem %>
I don't quite understand though, what exactly is the difference between those two? Is this just a matter of naming? Can they be used interchangeable?
There are two types of data-binding in ASP.NET namely, simple data-binding and declarative data binding.
The benefit of this feature is that we can bind the data to the display controls with strong types and we can avoid the exceptions caused by the function Eval(expression) if the expression is not evaluated to a proper value.
NET 4.5 provides ability to enable strongly-typed data templates. To enable them the ItemType property needs to be set on the data bound control.
Data binding forms the link to synchronize data between the data provider (data source) and the data consumer (UI displaying data), enabling two-way connection between visual elements and the data source.
This is the case:
Item
: for one-way binding expressions.
BindItem
: for two-way data-binding expressions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With