New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Two-way Declarative Binding

Under .NET 2.x/3.x framework you can use the newly introduced Bind() syntax to perform two-way binding (to and from the underlying database):

    <asp:TextBox id="TextBox1" runat="server" text='<%# Bind("Country") %>'>

This is especially useful for data editing operations like update or insert when you would like to retrieve/pass the new data to the underlying database without extra coding. Here are two online examples (in C# and VB.NET) which demonstrate this approach:

Auto-generated edit form

Form template edit form

With the Bind() syntax mentioned above you will be able to extract the updated by the user value from the FormTemplate without any additional code and pass it directly for the automatic update operation through the DataSource control (see Automatic DataSource operations).

In this article