Updating session variables
And when debugging, the pre-action events provide an opportunity for examining what parameters (if any) are being used to query the data. - the Sql Data Source and Object Data Source controls raise pre- and post-action events.
One event precedes the action, one event follows it.
Both controls raise pre- and post-action events when selecting, inserting, updating, and deleting data.
For example, the Sql Data Source and Object Data Source raise their event indicates, among other things, if an exception occurred during the operation.
Many real-world scenarios require that the parameters being used for selecting, inserting, updating, or deleting be programmatically assigned or altered, which can be accomplished in the appropriate pre-action event.
Moreover, to gracefully handle database- or object library-level exceptions in the page, the post-action event handlers should be used.
This article is one in a series of articles on ASP. While point-and-click data access is useful for prototyping and for beginners or hobbyists who have little to no programming experience, wizards and the like are generally frowned upon by more seasoned developers since they typically offer ease of use at the cost of extensibility and customizability. NET 2.0 data source controls, however, provide the best of both worlds, in my opinion - they can be quickly and easily configured to work with data, yet through a myriad of events that are raised during the data source controls' lifecycles, provide the flexibility for use in more advanced scenarios.