Adding Code  

In this step we add code to handle the Read, Save, Delete, and New button click events.

The code added to Page_Load is added to avoid unnecessary client/server synchronizations. The Page_Load event is triggered each time a page is refreshed. The IsPostBack flag is True when new data is retrieved from the server. Me.DataBind synchronizes the data on the Web page with the data retrieved from the server. In cases where no new data exists, we instruct the Web page not to synchronize with the server since it is not required.

The example code does not contain any error handling. However, in a real application, it may be desirable to implement an error handling scheme.