I have a gridview that I am using to delete rows from my database. I have set up a trigger on the SQL 2008 R2 database to write the deleted row to another table for auditing purposes. I need to capture three additional fields. One is easily created within the trigger, that is the timestamp. I can create a variable within the trigger to capture the date and time of the write to the deleted rows table. I am capturing a reason code on the web form from a drop down list associated with a table in SQL. I am also capturing the user logged into the web form with a Windows Authentication.
My problem is that I want the user to click the delete link on the gridview and at the same time pass the two variables (User ID and Reason Code) to the trigger which will insert the record into the table.
Is this possible - should I go another route? The current project will be used as a template for three or four other similar data entry and evaluation projects so I need to get this one functional and correct.