Adding First Controller:
Now we will start handling requests by adding controllers.As we already studied Controllers are the C# classes that are derived from System.Web.Mvc.Controller.
Now we will add controller by right click the Controllers folder in Solution Explorer and choose Add and then click Controller from the pop-up menu.
After that choose Empty MVC Controller then click Add.Then name the controller type in following pop-up(Here I'm given FirstController as controller name) then click Add.
Then visual studio create a FirstController.cs class under Controller folder and a folder with controller name under Views folder.
Visual Studio creates a default content in our controller like following.
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace FirstMVCApplication.Controllers { public class FirstController : Controller { // // GET: /First/ public ActionResult Index() { return View(); } } }