protected void Button2_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string fname = FileUpload1.FileName; string ext = System.IO.Path.GetExtension(fname); if (ext == ".jpg" || ext == ".JPG" || ext == ".jpeg" || ext == ".JPEG" || ext == ".gif" || ext == ".GIF") { FileUpload1.SaveAs(Server.MapPath("~/user/image/" + fname)); t.WriteData("insert into pro values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + FileUpload1.FileName + "','" + Session["phone"].ToString() + "')"); Response.Write("<script>alert('add successfully')</script>"); Session["name"] = TextBox1.Text; } } else { Response.Write("<script>alert('invalid')</script>"); } }
protected void Button1_Click(object sender, EventArgs e) { p.WriteData("insert into chat values('" + TextBox1.Text + "' ,'" + TextBox2.Text + "',getdate(),'" + Session["name"] + "','" + Session["phone"] + "','sender') "); }
protected void Button1_Click(object sender, EventArgs e) { Session["place"] = TextBox1.Text; p.WriteData("insert into notification values('" + TextBox1.Text + "','" + TextBox2.Text + "','" + Session["phone"].ToString() + "','" + Session["name"] + "',getdate())"); Response.Write("<script>alert('add suceefully')</script>"); }
protected void LinkButton2_Command(object sender, CommandEventArgs e) { p.WriteData("delete from notification where nid='" + e.CommandArgument.ToString() + "'"); Response.Write("<script>alert('deleted')</script>"); Server.Transfer("notification.aspx"); }
protected void Button1_Click(object sender, EventArgs e) { t.WriteData("insert into login values('" + TextBox1.Text + "','" + TextBox3.Text + "','user')"); Response.Write("<script>alert('successfully done')</Script>"); Server.Transfer("signin.aspx"); }