views:

71

answers:

1

ASP.Net:

In code-behind I can simulate <%# Eval("Property")%> with a call to DataBinder.Eval(myObject,"Property");

How do I simulate a call to <%# Bind("Property")%> ?

many thanks

+2  A: 

DataBinder.GetPropertyValue(myObject,"Property")

Mark Cidade
Does this do the two-way data binding in the same way as <%Bind... ?
Richard Nagle
No. Two-way binding is a bit more complex and is handled internally by the ControlBuilder class which uses the ExpressionBuilderContext, ExpressionBuilder, DataBindingCollection, DataBinding, and BoundPropertyEntry classes to process <%# Bind("Property") %>
Mark Cidade