Create First ASP.NET MVC5 Project

In this tutorial, you will learn:
1. How to Create ASP.NET MVC5 Project
2. How to change Authentication

Here, I am going to start a demo project that will go through the entire tutorial. This is the startup of the project and as the tutorials will move next, the more components will be added to this project.

Project Scenario
Here, I am going to develop a project on ComputerShop, in which I will implement following modules.
1. Item Entry
2. Stock Management
3. Billing System

All these modules will be covered through the entire tutorial. Here, in this chapter, we will just create an ASP.NET MVC5 Project CompShop and will do the following thing.

a. Create New Project CompShop
b. Add view pages and make navigation

Create New Project Compshop

1. Open Visual Studio 2015
2. Go to File New Project
3. Select Web in the left panel, Select ASP.NET Web Application (.NET Framework) in the middle panel, and give project name as CompShop. Click OK to continue.
New Project

4. In the next window, select MVC Template and change Authentication to No Authentication. Now, click OK and OK. Now your project has been opened in Visual Studio.

Select MVC Template

Change the Home Page Style and Title

Step 1: Go to Solution Explorer Views Home and open Index.cshtml.
Index Step 2: Change the page as follows:
@{
    ViewBag.Title = "Computer Shop Management";
}

<div class="jumbotron">
    <h2 style="color:chocolate">Welcome to Computer Shop Management</h2>
    <p>Manage all your sales and profit with this awesome online tool.</p>
</div>
 
Step 3: Open Shared Layout.cshtml and change the Application Name into CompShop Studio.
Layout
a. Find the following line of code.
@Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })

b. And Replace with this code.
@Html.ActionLink("CompShop Studio", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })

Step 4: Press F5 to run your Project. Output

Congratulations! You have started your First MVC 5 Project. By involving your small effort, very soon you will be the master in ASP.NET MVC 5. In the next chapter, you will learn about MVC Guidelines and Folder Structure.

More Articles

 

Share your thought