protected void btnregistrar_Click(object sender, EventArgs e) { SaveEjercicioFoto(); TheGym k = new TheGym { NombreEjercicio = tbnombre.Text, FKelementos = ddlelemento.SelectedValue, FKgrupomuscular = ddlgrupomuscular.SelectedValue, ImagenesEjercicio = "~/ImagenesSistema/" + tbnombre.Text + extention, DescripcionEjercicio = tbdescripcion.Text }; try { k.AddEjercicio(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#modal-default').modal('show');", true); } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } tbnombre.Text = string.Empty; ddlelemento.ClearSelection(); ddlgrupomuscular.ClearSelection(); tbdescripcion.Text = string.Empty; { } }