Example #1
0
        [ValidateInput(false)]  // Allow HTML markup in content. ContentManager will encode the markup prior to storage in the repository.
        public RedirectToRouteResult EditEnd(string button, bool Create, string Content, int Id, string Path, string Summary, string Title)
        {
            // On cancellation of a new node, go to the Index action of this controller.
            if (Create && (button == "Cancel"))
            {
                return(RedirectToAction("Index"));
            }


            if (button == "Save")
            {
                if (Create)
                {
                    // Create the new node.
                    contentManager.BlogEntryCreate(Title, Summary, Content);
                }
                else
                {
                    // Update the existing node.
                    contentManager.ContentUpdate(Id, Title, Summary, Content);
                }
            }


            // Show the node, whether saved or cancelled.
            string url = "/Display/" + Path;

            return(RedirectToAction(url));
        }