protected void Button2_Click(object sender, EventArgs e) { DataTable db = user.getUser(TextBox1.Text); if (db.Rows.Count > 0) { Label1.Text = db.Rows[0][5].ToString(); } else { Response.Write("<script>alert('该用户不存在');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Userinfo us = new Userinfo(); string username = Session["username"].ToString(); DataRow dr = us.getUser(username).Rows[0]; Label2.Text = username; TextBox1.Text = dr["password"].ToString(); TextBox4.Text = dr["email"].ToString(); TextBox2.Text = dr["question"].ToString(); TextBox3.Text = dr["answer"].ToString(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!us.IsLogin()) { Response.Redirect("login.aspx?ReturnUrl=userinfo.aspx"); } else { userid = us.getUserID(); DataTable db = us.getUser(userid); Label1.Text = db.Rows[0][1].ToString(); TextBox1.Text = db.Rows[0][4].ToString(); TextBox2.Text = db.Rows[0][5].ToString(); TextBox3.Text = db.Rows[0][6].ToString(); ObjectDataSource1.SelectParameters.Clear(); ObjectDataSource1.SelectParameters.Add("userid", userid.ToString()); //DataTable orderdb = Oorder.getordersbyuserid(userid); //ListView1.DataSource = orderdb; ListView1.DataBind(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!user.IsLogin()) { Response.Redirect("login.aspx?ReturnUrl=feedback.aspx"); } else { userid = user.getUserID(); DataTable db = user.getUser(userid); TextBox4.Text = db.Rows[0][1].ToString(); } } }