Book Image

SignalR Blueprints

By : Einar Ingerbrigsten
Book Image

SignalR Blueprints

By: Einar Ingerbrigsten

Overview of this book

Table of Contents (18 chapters)
SignalR Blueprints
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
9
Debugging or Troubleshooting
Index

The newsroom


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.

Note

Note the Authorize attribute (this time, it's the MVC version).

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...