コード例 #1
0
        /// <summary>
        /// Produces a partial view where a visitor can
        /// contact the site creator by leaving a comment
        /// or by sending an external message
        /// </summary>
        /// <returns></returns>
        public ActionResult Contact()
        {
            /* Retrieve a list of all VisitorComment objects */
            List <VisitorComments> allComments = CommentDBHelper.getAllComments(_db);

            /* Pass them to a partial view to be displayed */
            return(PartialView(allComments));
        }
コード例 #2
0
        public PartialViewResult Create(VisitorComments vComment)
        {
            if (ModelState.IsValid)
            {
                CommentDBHelper.addComment(_db, vComment);

                //return RedirectToAction("Contact");
                return(PartialView("Contact", CommentDBHelper.getAllComments(_db)));
            }

            return(PartialView(vComment));
        }