protected void TextBox1_TextChanged(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); if (Regex.IsMatch(TextBox1.Text, "^[a-z0-9]{5,}$")) { int respval = s.UserCheck(TextBox1.Text); if (respval == 1) { userun.InnerText = "*Username is not available"; userun2.InnerText = ""; HiddenField1.Value = "0"; } else { userun2.InnerText = "*Username available"; userun.InnerText = ""; HiddenField1.Value = "1"; } } else if (TextBox1.Text == "") { userun.InnerText = ""; userun2.InnerText = ""; HiddenField1.Value = "0"; } else { userun.InnerText = "*Username should have only lowercase alphanumerics(min 5)"; userun2.InnerText = ""; HiddenField1.Value = "0"; } }
protected void TextBox1_TextChanged(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); if (TextBox1.Text != "") { int respval = s.UserCheck(TextBox1.Text); if (respval == 0) { userun.InnerText = "*Username does not exist"; } else { userun.InnerText = ""; Session["username"] = TextBox1.Text; string sec = s.Fetch(TextBox1.Text); string [] secqa = sec.Split('~'); Session["question"] = secqa[0]; Session["answer"] = secqa[1]; TextBox1.Visible = false; TextBox3.Text = secqa[0]; TextBox3.Visible = true; TextBox4.Visible = true; } } else { userun.InnerText = ""; } }
protected void ImageButton1_Click(object sender, ImageClickEventArgs e) { Response.ContentType = "application/exe"; Response.AppendHeader("Content-Disposition", "attachment; filename=DataMiner.exe"); localhost.Service1 s = new localhost.Service1(); byte[] b1 = null; b1 = s.DownloadFile(); Response.OutputStream.Write(b1, 0, b1.Length); Response.End(); }
protected void Button1_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); if (s.ResetPassword((string)Session["username"], TextBox2.Text)) { Session["reset"] = "true"; Response.Redirect("Login.aspx", false); } else { Response.Write("<script>alert(\"Unexpected error\")</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); int respval = s.LoginValidate(TextBox1.Text, TextBox2.Text); if (respval == 0) { error.InnerText = "*Please check your Username and Password"; } else { Session["UID"] = TextBox1.Text; Response.Redirect("Home.aspx", false); } }
protected void Button1_Click(object sender, EventArgs e) { localhost.Service1 s = new localhost.Service1(); if (HiddenField1.Value == "1") { int respval = s.InsertReg(TextBox1.Text, TextBox3.Text, TextBox2.Text, DropDownList1.SelectedValue.ToString(), TextBox5.Text, TextBox6.Text, DropDownList2.SelectedValue.ToString(), TextBox7.Text.ToLower().Trim()); if (respval == 0) { error.InnerText = "*Registration unsuccessful...Please try again later!"; } else { Session["reg"] = "1"; Response.Redirect("Login.aspx", false); } } }