private void btnDeleteText_Click(object sender, EventArgs e) { //刪除一個問答題 //取得QID string[] strIDArray = ((Button)(sender)).ID.Split('-'); string strQID = strIDArray[1]; //設定QID的Session if (Session["QID"] != null) { Session["QID"] = strQID; } else { Session.Add("QID", strQID); } //刪除該問答題 SQLString.deleteTextQuestionByQID(strQID); //刪除該問答題的同義問題與答案 clsInterrogationEnquiry.DeleteQuestionItem(strQID); //清除 tcQuestionTable.Controls.Clear(); tcTextQuestionTable.Controls.Clear(); intQuestionIndex = 0; //建立選擇題 this.setupQuestionTable(); //建立問答題 this.setupTextQuestionTable(); }