entre Desarrolladores

Recibe ayuda de expertos

Registrate y pregunta

Es gratis y fácil

Recibe respuestas

Respuestas, votos y comentarios

Vota y selecciona respuestas

Recibe puntos, vota y da la solución

Pregunta

1voto

al entrar una funcion js que me mande a un ejecucion de asp

Hola a todos, de antemano perdon si digo algo incorrecto pero no estoy muy familiarizada con ASP
sucede que estoy usando un componente de step by step, entonces al momento que le doy siguiente quiero que ejecute un metodo de asp que ya tenia en un boton, dejo mi codigo para darme a entender mejor

 <table class="table no-margin"> <tr><td> 
      <div class="row">
        <div class="col-12" id="div1">
           <asp:TextBox ID="cc1" runat="server" MaxLength="3" Width="35px" placeholder="121"></asp:TextBox>
           <asp:TextBox ID="cc2" runat="server" MaxLength="2" Width="35px" placeholder="00"></asp:TextBox>
           <asp:TextBox ID="cc3" runat="server" MaxLength="3" Width="35px" placeholder="000"></asp:TextBox>
           <asp:TextBox ID="cc4" runat="server" MaxLength="2" Width="35px" placeholder="00"></asp:TextBox>
           <asp:TextBox ID="cc5" runat="server" MaxLength="2" Width="35px" placeholder="00"></asp:TextBox>
           <asp:TextBox ID="cc6" runat="server" MaxLength="4" Width="35px" placeholder="0000"></asp:TextBox>
         </div>
        </div>
     </td>
</tr>
tr><td><asp:Button ID="Buscar" runat="server" Text="Buscar" OnClick="Button1_Click" class="btn btn-block ink-reaction btn-primary-bright"/></td></tr>  /////// este boton de buscar me manda a este codigo
</table> 

codigo del boton

  protected void Button1_Click(object sender, EventArgs e)
        {
            inmueble.Visible = true;
            Importes.Visible = false;
            limpiar();
            int anoi, mesi, i, x;
            string a = "00";
            cnx = new SqlConnection(con);
            cnx.Open();
            query = new SqlCommand();
            query.CommandType = CommandType.Text;
            query.CommandText = "select PMNProp, DomFis, Colonia1, F_AÑO, F_MES, VCatastralc, F_BLOQUEO, Convenio, P_EMBARGO, P_NOTIFICA , STerrProp, SConsProp from PADRON_GENERAL WHERE (Municipio = '" + cc1.Text + "') AND (Zona = '" + cc2.Text + "') AND (Manzana = '" + cc3.Text + "') AND (Lote = '" + cc4.Text + "') AND (Edificio = '" + cc5.Text + "') AND (Depto = '" + cc6.Text + "') ";
            query.Connection = cnx;
            datos = new DataSet();
            SqlDataAdapter adaptador = new SqlDataAdapter(query);
            adaptador.Fill(datos, "PADRON_GENERAL");
            if (datos.Tables["PADRON_GENERAL"].Rows.Count > 0)
            {
                Label1.Text = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["PMNProp"]);
                Label2.Text = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["DomFis"]);
                Label3.Text = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["Colonia1"]);
                Label4.Text = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["F_AÑO"]) + "/" + a.Substring(1, 2 - Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["F_MES"]).Length)  +  Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["F_MES"]);
                anoi = Convert.ToInt16(datos.Tables["PADRON_GENERAL"].Rows[0]["F_AÑO"]);
                mesi = Convert.ToInt16(datos.Tables["PADRON_GENERAL"].Rows[0]["F_MES"]);
                valcat = Convert.ToDouble(datos.Tables["PADRON_GENERAL"].Rows[0]["VCatastralc"]);
                notif = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["P_NOTIFICA"]);
                bloq = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["F_BLOQUEO"]);
                emba = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["P_EMBARGO"]);
                conv = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["Convenio"]);
                Label9.Text  = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["STerrProp"]);
                Label8.Text  = Convert.ToString(datos.Tables["PADRON_GENERAL"].Rows[0]["SConsProp"]);
                if (bloq=="SI" | conv == "S")
                {
                    Response.Write("<script language=javascript>");
                    Response.Write("alert ('La Clave Catastral se encuentra bloqueada o en convenio , Favor de pasar a las oficinas de Tesoreria en OPERAGUA')");
                    Response.Write("</script>");
                    Calcular.Enabled = false;
                }
                else
                {
                    Calcular.Enabled = true;
                    impuesto(valcat, DateTime.Today.Year, cc1.Text, cc2.Text, cc3.Text, cc4.Text, cc5.Text, cc6.Text);
                    salmin(DateTime.Today.Year);
                    Label5.Text = Convert.ToString(impuestocalc);
                    Label6.Text = notif;
                    Label7.Text = emba;
                    anoini = anoi;
                    mesini = mesi;
                    db_periodo.Items.Clear();
                    i = mesi;

                    for (x = anoi; x <= DateTime.Today.Year; x++)
                    {
                        if (impuestocalc <= dia6)
                        {
                            for (i = mesi; i <= 12; i = i + 12)
                            {
                                    db_periodo.Items.Add(x + "/12");
                            }
                        }
                        if (impuestocalc > dia6 & impuestocalc <= dia9)
                        {
                            if (i >= 12)
                            {
                                mesi = 1;
                            }
                            for (i = mesi + 5; i <= 12; i = i + 6)
                            {
                                db_periodo.Items.Add(x + "/" + a.Substring(1, 2 - Convert.ToString(i).Length)+i);
                            }
                        }
                        if (impuestocalc > dia9)
                        {
                            if (i >= 12)
                            {
                                mesi = 1;
                            }
                            for (i = mesi + 1; i <= 12; i = i + 2)
                            {
                                db_periodo.Items.Add(x + "/" + a.Substring(1, 2 - Convert.ToString(i).Length)+i);
                            }
                        }
                    }

                }

            }
            else
            {
                db_periodo.Items.Clear();
                Response.Write("<script language=javascript>");
                Response.Write("alert ('La clave catastral no existe')");
                Response.Write("</script>");
                cc1.Text = "";
                cc2.Text = "";
                cc3.Text = "";
                cc4.Text = "";
                cc5.Text = "";
                cc6.Text = "";
            }
        }

        }
    }

yo lo que quiero es que al darle siguiente a mi componente me mande a lo que ahora manda el boton de buscar, no se si me doy a entender pero la verdad no entiendo mucho de ASP y quiero aprender, para mi es mas facil hacerlo con php pero con este lenguaje no tengo mucha idea, no se si alguien me pueda dar un poco de ayuda para entender mejor de que manera me puede salir lo que busco cabe mencionar que en el componente cuando le doy siguiente ya entro a una funcion que me manda un mensaje para validar que si entre correctamente, entocnes yo quiero sustituir el boton de buscar por el de mi componente

GRACIAS

Por favor, accede o regístrate para responder a esta pregunta.

Otras Preguntas y Respuestas


...

Bienvenido a entre Desarrolladores, donde puedes realizar preguntas y recibir respuestas de otros miembros de la comunidad.

Conecta