Now that we basically have everything in place to display the news articles up and running, we need to be able to publish them as well, otherwise there won't be anything to show.
Let's start by creating a new controller in the Controllers
folder called NewsroomController
; we will only need a default route of Index
, so make the controller look like the following code snippet:
using System.Web.Mvc; namespace Chapter3.Controllers { [Authorize] public class NewsroomController : Controller { // GET: Content public ActionResult Index() { return View(); } } }
We've also secured the entire newsroom at this point, so we will need a user to be able to publish anything.
Let's move on by creating the index view for the newsroom. Add a new folder in the Views
folder called Newsroom
and add a new empty view called Index.cshtml
in it.
Let's enter the title and a reference...