See the question and my original answer on StackOverflow

Sorry if this is a bit late :-)

'Bind' is a strange beast. There is no Bind method nowhere. It's just a specific ASP.NET token that instructs the ASP.NET compiler to adds 'Eval' call (there is an Eval method indeed) on databinding and generates a specific extraction code hidden method for dual way binding.

But this method is only added (and called on extraction) for controls that are equipped with ITemplate properties (such as FormView's ItemTemplate, EditItemTemplate, etc...), and that are declared two-ways bindable.

Unfortunately, for a user control (an ascx), there is no easy way to have that kind of method generated.

However, there is the IBindableControl Interface that you could implement in the user control that allows some integration although it's less automatic, less declarative, like this:


<asp:TextBox ID="txt1" runat="server" Text='<%# Eval("Name") %>' />

(Note the Bind is useless so you can just stick with Eval).


public partial class WebUserControl : UserControl, IBindableControl
    public void ExtractValues(IOrderedDictionary dictionary)
        dictionary["Name"] = txt1.Text;