protected void gvDirecciones_RowCommand(object sender, GridViewCommandEventArgs e) { Direccion aux = new Direccion(); int index = Convert.ToInt32(e.CommandArgument); aux.ID = Convert.ToInt32(gvDirecciones.Rows[index].Cells[0].Text.ToString()); aux.NombreDireccion = gvDirecciones.Rows[index].Cells[1].Text; aux.Altura = Convert.ToInt32(gvDirecciones.Rows[index].Cells[2].Text); aux.CP = Convert.ToInt32(gvDirecciones.Rows[index].Cells[3].Text); aux.Localidad = gvDirecciones.Rows[index].Cells[4].Text; if (e.CommandName == "Seleccion") { Session["DireccionUsuario"] = aux; Response.Redirect("SeleccionarPago.aspx"); } else if (e.CommandName == "Eliminar") { negocio.BorrarDireccion(aux.ID); Response.Redirect("Elegir_Envio.aspx"); } }