Duration: 17 minutes
Summary: In the previous video we discussed how to use the Eval expression to display fields in a Repeater. As you recall, we were able to only display the data. In this video, we will be discussing two-way binding, by using the Bind expression that allows us to display and edit data. We add a FormView that is tied to a SqlDataSource. In the data source, we added the ability to insert, update and delete data. We also provided the DeleteParameters, InsertParameters, and UpdateParameters. In the FormView, we added the EditItemtemplate, within the template we add all the controls necessary to do the edits. We added two labels and two textboxes to be able to display the first name and the last name. We use the Bind expression with the text property of the textboxes. That way the user can edit the data. As far as saving the changes, we added a button to the edit template. The CommandName for that button was “Update”. Now all the changes will be saved using the UpdateCommand in the data source.
Methodology of the development of example: Good coding standard and simplified design to illustrate the key points.
Technology Used: ASP.NET and Visual Studio 2010
Keyword: ASP.NET 4, Visual Studio 2010, FormView, EditItemTemplate, SqlDataSource, DeleteParameter, InsertParameter, UpdateParameter, DeleteCommand, InsertCommand, SelectCommand, UpdateCommand, Bind, Eval, CommandName.