Ejemplo n.º 1
0
 protected void DeleteMyComment_Button_Click(object sender, EventArgs e)
 {
     if (Session["UserInfo"] != null)
     {
         MessageInfo mycomment_ = new MessageInfo();
         mycomment_.MessageID = int.Parse(mycomment.Tables["CourseComment"].Rows[0]["CommentID"].ToString());
         if (1 == mycomment_.DeleteComment())
         {
             AllDataBind();
         }
         else
         {
             AllDataBind();
             ScriptManager.RegisterStartupScript(Page, GetType(), "deletefailed", "alert('删除失败或评论不存在');", true);
         }
     }
     else
     {
         HttpContext.Current.Response.Write("<script type='text/javascript'>alert('闲置时间过长,请重新登录');location.href='" + Request.Url.AbsoluteUri + "'</script>");
     }
 }