protected void grvmantemercado_RowCommand(object sender, GridViewCommandEventArgs e) { int fila = Convert.ToInt32(e.CommandArgument); int idmer = Convert.ToInt32(grvmantemercado.Rows[fila].Cells[0].Text); if (e.CommandName == "Modificar") { Response.Redirect("~/ModMercado.aspx?IDM=" + idmer, true); } else if (e.CommandName == "Ver") { Response.Redirect("~/VerMercado.aspx?IDM=" + idmer, true); } else if (e.CommandName == "Eliminar") { MercadoDAO db = new MercadoDAO(); db.Eliminar(idmer); cargar(); string script = "openModal();"; ScriptManager.RegisterStartupScript(this, typeof(Page), "correcto", script, true); } }