-
Notifications
You must be signed in to change notification settings - Fork 0
Home
To start, create a new project in Visual Studios. The project should be C# for web and the type is named "ASP.NET Web Application".
On the next page the template you should use is MVC. On the same page change the authentication method to "No Authentication" (It's just easier for this example).
Once the project has been created it will have a lot of stuff we don't care about. Navigate to the ~/Controllers/HomeController.cs and remove the two actions that are not Index. The ~/Controllers/HomeController.cs should looks like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace Example.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
}Delete the ~/Views/Home/About.cshtml and the ~/Views/Home/Index.cshtml as we will not be using these either.
Open ~/Views/Home/Index.cshtml and delete everything on the file (but keep the file).
Replace the contents of ~/Views/Shared/Layout.cshtml with:
<!DOCTYPE html>
<html>
<head>
<title>Example Title</title>
</head>
<body>
<div id="content"></div>
@RenderBody()
</body>
</html>there are many other files we could remove to minimize the project, but we won't be worrying about those as they are not going to affect us at all.
From this point, the project should run and display a blank page.