Some good examples of convention:
1. Name controllers with trailing word “Controller”
AccountController.cs
HomeController.cs
Daily Archives: May 27, 2014
Baby step 1 – getting around – links and such
Recipe:
1. Controller – add ActionResult to existing controller(HomeController)
2. View – add the Raisor CSHtml
1. Controller – add ActionResult to existing controller: /home/Controllers/HomeController.cs
namespace MVC_Richtest.Controllers { public class HomeController : Controller { public ActionResult Index() { ViewBag.Message = "Welcome to ASP.NET MVC!"; return View(); } public ActionResult About() { return View(); } public ActionResult Argh() { return View(); } } }
2. Create a corresponding file in /views/Home/Argh.cshtml
@{ ViewBag.Title = "Argh"; } <h2>Ahoy Matey</h2> <p> No doubt ye be wonderin' what this page be about. Well, argh, it is about nothin' special, see. And any scalaway sea cow's loving scourge should know better. Argh! </p>