I have a LOG table like this.
Process_Type (Could be Update, View),
Username, Date
In my page I have only one Gridview.
I want to log user’s information (username, date, process_type) in LOG table.
1.View
Should I use Page_Load() function? (Because Gridview binding on the load of page) I think I should update my table like this;
UPDATE LOG
SET PROCESS_TYPE = 'VIEW', USERNAME = Request.ServerVariables["AUTH_USER"],
DATE = DateTime.Now
2.UPDATE
Should I use Gridview1_OnRowUpdating() function ? I think I should update my table like this;
UPDATE LOG
SET PROCESS_TYPE = 'UPDATE', USERNAME = Request.ServerVariables["AUTH_USER"],
DATE = DateTime.Now
Is this a good plan for logging my simple page?
Or, How can I do that more easily?
To log the View, you should use
DataBoundand for update useRowUpdated