protected void Button2_Click(object sender, EventArgs e) { if (DropDownList1.Items.Count > 0) //你没有评论过干嘛点修改评论 { int cid = sigma[DropDownList1.SelectedIndex].CId; //待修改评论id if (CommentsManager.UpdateCommentByCid(TextBox1.Text, TextBox2.Text, cid)) { //修改成功 Response.Write("<script>alert('修改成功.');window.location.href='Comments_Control.aspx';</script>"); } else { //修改失败 Response.Write("<script>alert('修改失败.');</script>"); } } else { Response.Write("<script>alert('你还没有评论过呢,快去写几篇吧老师.');</script>"); } }