protected void gvCompany_RowCommand(object sender, GridViewCommandEventArgs e) { ClearControl(); if (e.CommandName == "EditCompany") { ApplicationID = Convert.ToInt32(e.CommandArgument); try { BindApplicationToUpdate(); } catch (Exception exc) { ShowMessage(ref lblMessage, MessageType.Danger, exc.Message); lblMessage.Visible = true; } } if (e.CommandName == "deleteCompany") { int SApplicationID = Convert.ToInt32(e.CommandArgument); try { int retID = client.DeleteCompany(SApplicationID); ShowMessage(ref lblMessage, MessageType.Success, "Record deleted successfully."); lblMessage.Visible = true; BindAllApplicationDetails(); } catch (Exception exc) { ShowMessage(ref lblMessage, MessageType.Danger, exc.Message); lblMessage.Visible = true; } } }