Ejemplo n.º 1
0
        public ActionResult AddComment()
        {
            var     name    = Request.Form["comName"];
            var     email   = Request.Form["comEmail"];
            var     content = Request.Form["comContent"];
            var     blogId  = Convert.ToInt32(Request.Form["hidBlogId"]);
            Comment comment = new Comment()
            {
                Commenter  = name,
                CreateTime = DateTime.Now,
                Content    = content,
                Email      = email,
                BlogId     = blogId
            };

            BlogModel.AddComment(comment);
            return(RedirectToAction("Post", "Home", new { id = comment.BlogId }));
        }