The second lesson in this chapter demonstrates how you can bind to data to allow users to interact with it.
The lesson covers using web server controls such as Grid View, Repeater, Details View, and many more.
Recently I was tasked with encrypting/decrypting some data that could be edited using ASP. Along with the details view control, the legacy code used a SQL Data Source to select and update everything.
This means the data access layer was bypassed completely, so any business logic that dealt with encryption on this page had to use a different execution path. The problem could be divided into two tasks: The first task was the easier of the two, as it just involved referencing the encryption library from the code behind page and calling the function inline in the aspx page.
They make it easier to build webpages that access, display, manipulate, and save data. You use these controls to configure access to data that you intend to use on a webpage.
NET view and replace the Customer ID Text Box with a Drop Down List.Next you will need to configure the data source for the Drop Down List and bind the Drop Down List to the source for the list items and the source for the selected value.Here are the steps: The last steps require that you bind the Data Text Field and Data Value Field properties to the Customer IDData Source and the Selected Value to the original source's Customer ID.After setting the Details View’s Item Updating method, you will need to modify the SQL Data Source’s Update Command, Update Command Type, and Update Parameters.The legacy code in the SQL data source used a update statement with parameters.