public string RemoveComment(string commentID, string pid) { AjaxResponse resp = new AjaxResponse(); resp.rs1 = commentID; Guid?id = null; try { if (!String.IsNullOrEmpty(commentID)) { id = new Guid(commentID); } } catch { return(commentID); } BlogsEngine engine = BasePage.GetEngine(); var comment = engine.GetCommentById(id.Value); if (comment == null) { throw new ApplicationException("Comment not found"); } CommunitySecurity.DemandPermissions(comment, ASC.Blogs.Core.Constants.Action_EditRemoveComment); comment.Inactive = true; var post = engine.GetPostById(comment.PostId); engine.RemoveComment(comment, post); return(commentID); }