//Tabstrip //Script for raising a JavaScript alert for delete gridview.rowdatabound e.Row.Cells[4].Attributes.Add("onClick", "return confirm('Are you sure you want to delete this record?');"); //Sorting the grid view dataview.sort gridview.sorting //In set form mode, initialize SortColumn and SortDirection //Psuedo code for sorting event: Load the sort expression into session memory by retrieving the SortExpression from the grid view Retrieve the sort direction from session memory If the direction is asc, change it to desc repopulate the gridview //Error handling //Data tier BEGIN TRY BEGIN TRANSACTION --Some SQL statements COMMIT TRANSACTION END TRY BEGIN CATCH DECLARE @ErrorMessage VARCHAR(500) SET @ErrorMessage = ERROR_MESSAGE() + ' Rolledback transaction: [message here].' ROLLBACK TRANSACTION RAISERROR (@ErrorMessage, 16,1) END CATCH //Presentation tier //Check for an error at the dataAccess or data tier if (objUser.TransactionSuccessful()) { //Check for a presentation tier error (most commonly a bind error) try { //Try something } catch (Exception BindError) { lblSystemMessage.Visible = true; lblSystemMessage.Text = "PresentationTier error: " + BindError.Message.ToString(); } } else { lblSystemMessage.Visible = true; lblSystemMessage.Text = "DataTier error: " + objUser.ErrorMessage(); } }