protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { int codigo = 0; switch (e.CommandName) { case "Alterar": codigo = Convert.ToInt32(e.CommandArgument); Session["ID"] = codigo; Response.Redirect("AlterarCliente.aspx"); break; case "Deletar": codigo = Convert.ToInt32(e.CommandArgument); UsuariosBD bd = new UsuariosBD(); bd.Delete(codigo); Carrega(); break; default: break; } }