I am performing database update call by clicking on a button which resides on a gridview. It works fine it updates the database properly but the problem is that when i refresh the page it again perform the same operation(db update) i.e again call the RowCommand Event of Gridview.
Here is my short code view:
protected void gridview_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "lnkBtn1")
{
userDetails obj=new userDetails();
bool flag=obj.Updatuser();
if (flag)
{
lblSucess.Visible = true;
//this will binds updated table to grid
this.BindGrid();
}
else
{
lblError.visible=true;
}
}
}