protected void Bind() { if (id != 0) { if (Tools.TryParseMethod(id.ToString()) != 0) { ContactInfo info = cBLL.GetDataById(id); txtTitle.Text = "【回覆】:" + info.c_subject; txtName.Text = info.c_name; litPhone.Text = info.c_phone1; litFax.Text = info.c_phone2; txtMail.Text = info.c_mail; litSex.Text = info.c_sex; } } }
protected void btncheck_Command(object sender, CommandEventArgs e) { ContactInfo info = cBLL.GetDataById(int.Parse(e.CommandArgument.ToString())); info.c_check_read = true; cBLL.Update(info); ObjectDataSource2.SelectParameters["c_id"].DefaultValue = e.CommandArgument.ToString(); //特定Command按鈕 LinkButton lnkCheck = (LinkButton)sender; if (lnkCheck.Text == "檢視") { FormView1.Visible = true; //文字全部改為:檢視 for (int i = 0; i < gridView.Rows.Count; i++) { LinkButton lnkCheckText = (LinkButton)gridView.Rows[i].Cells[6].FindControl("btncheck"); lnkCheckText.Text = "檢視"; } lnkCheck.Text = "隱藏"; } else { FormView1.Visible = false; lnkCheck.Text = "檢視"; gridView.DataBind(); } FormView1.DataBind(); }