protected void Button1_Click(object sender, EventArgs e) { ClasslLog log = new ClasslLog(); DataTable tabla = log.Inicio(TextBox1.Text, TextBox2.Text); if (tabla.Rows.Count > 0) { Response.Redirect("~/Contact.aspx"); Session["permiso"] = "valido"; } else { Response.Redirect("~/login.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { ClasslLog LgInicio = new ClasslLog(); this.GridView1.DataSource = LgInicio.Inicio(this.TextBox1.Text, this.TextBox2.Text); this.GridView1.DataBind(); if (this.GridView1.Rows.Count > 0) { Session["usuario"] = TextBox1.Text; Response.Redirect("Contact.aspx"); } else { Response.Redirect("WebFormLogin.aspx"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { if (Page.IsValid && (txtCaptcha.Text.ToString() == Session["RandomStr"].ToString())) { Response.Write("Code verificacition"); ClasslLog l = new ClasslLog(); try { string mensaje = l.Ingresar(TextBox1.Text, TextBox3.Text, TextBox2.Text, "1"); } catch (Exception) { throw; } } else { Response.Write("Please enter infor"); } }