I am developing a web application where I am using a GridView control to load data from the database. 

I have a row that is loaded in editable mode. I have a save button which the user clicks after making the changes, and I want to check the IsDirty flag to stop the user from saving and notify them via an alert box. I'm using a Web User Control (ASCX) to load the GridView. How can I check dirty rows in the grid and stop the user from saving when user clicks the save button or logout button?? 

P.S. I am using a LoginView for the logout button.