protected void Delete_CommentReply_LinkButton_Click(object sender, CommandEventArgs e) { if (Session["UserInfo"] != null) { MessageInfo replycomment = new MessageInfo(); replycomment.MessageID = int.Parse(e.CommandArgument.ToString()); replycomment.DeleteCommentReply(); mynewcomment = user.GetNewComment(); AspNetPager.RecordCount = mynewcomment.Tables["NewComment"].Rows.Count; AllMyNewComment_DataList.DataSource = FilterTable(mynewcomment.Tables["NewComment"], AspNetPager.StartRecordIndex - 1, AspNetPager.EndRecordIndex - 1); AllMyNewComment_DataList.DataBind(); //Response.Redirect(Request.Url.AbsoluteUri); } }
protected void Delete_CommentReply_LinkButton_Click(object sender, CommandEventArgs e) { if (Session["UserInfo"] != null) { MessageInfo replycomment = new MessageInfo(); replycomment.MessageID = int.Parse(e.CommandArgument.ToString()); if (1 == replycomment.DeleteCommentReply()) { AllDataBind(); } else { ScriptManager.RegisterStartupScript(Page, GetType(), "deletefailed", "alert('删除失败');", true); } } else { HttpContext.Current.Response.Write("<script type='text/javascript'>alert('闲置时间过长,请重新登录');location.href='" + Request.Url.AbsoluteUri + "'</script>"); } }