protected void btn_guardar_ServerClick(object sender, EventArgs e)
        {
            if (this.Page.IsValid)
            {
                try
                {
                    if (FormAccion == "Agregar")
                    {
                        WSGestion.WSGestion wsgest = new WSGestion.WSGestion();
                        wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs");
                        WSGestion.MOD_Mascota obj = new WSGestion.MOD_Mascota();
                        txt_codigo.Value = "0";
                        obj.MAS_id_mascota = Convert.ToInt32(txt_codigo.Value);
                        obj.MAS_id_raza = Convert.ToInt32(dlRaza.SelectedValue);
                        obj.MAS_nombre = txt_nombre.Value;
                        obj.MAS_fecha_nacimiento = txt_fecha_nacimiento.Text;
                        obj.MAS_sexo = dl_sexo.SelectedValue;
                        obj.MAS_color = txt_color.Value;
                        obj.MAS_observaciones = txt_observaciones.Value;
                        obj.DXM_id_dueno = Convert.ToInt32( txt_codigo_dueno.Value);
                        wsgest.CRE_Mascota(obj);

                        Response.Redirect("frm_Grid_Mascota.aspx");
                    }

                    if (FormAccion == "Editar")
                    {
                        WSGestion.WSGestion wsgest = new WSGestion.WSGestion();
                        wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs");
                        WSGestion.MOD_Mascota obj = new WSGestion.MOD_Mascota();

                        obj.MAS_id_mascota = Convert.ToInt32(txt_codigo.Value);
                        obj.MAS_id_raza = Convert.ToInt32(dlRaza.SelectedValue);
                        obj.MAS_nombre = txt_nombre.Value;
                        obj.MAS_fecha_nacimiento = txt_fecha_nacimiento.Text;
                        obj.MAS_sexo = dl_sexo.SelectedValue;
                        obj.MAS_color = txt_color.Value;
                        obj.MAS_observaciones = txt_observaciones.Value;
                        obj.DXM_id_dueno = Convert.ToInt32(txt_codigo_dueno.Value);

                        wsgest.UPD_Mascota(obj);
                        Response.Redirect("frm_Grid_Mascota.aspx");
                    }
                }

                catch (Exception exc)
                {
                    Alert_Mensaje.Attributes["class"] = "alert alert-danger";
                    mensaje_alerta = exc.ToString();
                    titulo_mensaje_alerta = "Error: ";
                    Alert_Mensaje.Visible = true;
                }

            }
        }