Implementing Two-Way Control Binding for Web Forms : Page 4
ASP.NET's native data binding provides only one-way data binding. With a little bit of effort, it's possible to extend the native functionality and provide flexible two-way data binding and a few other simple enhancements that drastically reduce the amount of code you have to write for binding data to controls.
by Rick Strahl
Dec 1, 2003
Page 4 of 7
Adding Controls to the Form
The first step is to add the wwWebDataControls.dll to the Toolbar by following these steps:
Select the Toolbox.
Right-click and select Add New Tab.
Type the name for this tab (e.g., West Wind Web Controls).
Select the new tab.
Right-click again and select Add/Remove Items.
Browse for the installation directory for the samples and select the data binding/wwWebDataControls/bin/Debug/wwWebDataControls.dll.
Later, you'll probably want to install this to the GAC. For now, it's handy to use the debug version so you can change the controls.
Drag and drop the controls onto the form.
The controls use a default script tag prefix of ww, which is registered against the DLL. Here's the script code for the header:
If you use the toolbar, you won't have to do any of this manually. What's nice about this form is that other than the property assignments that are made in the property sheet (Figure 4), there's no code involved in the data binding. It's quick and easy to create the data bindings in this fashion.