Creating your first Asp.Net Mvc application
Visual Studio Created Asp.Net Mvc application.
Now, than after add Controller to your project.
Now, This will created class file HomeController.cs under controllersfolder.
using System;
using System.Web.Mvc;
using System.Web.Mvc;
namespace MyFirstMVCApplication.Controllers
{
public class
HomeController : Controller
{
public ViewResult
Index()
{
return
View();
}
}
}
}
}
Now , We add new View to our Home Controller to add new view , right click on View folder and click Add => View.
![]() |
| View |
New CSHTML file inside View/Home folder with the following code.
@{
Layout = null;
}
<html>
<head>
<meta
name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
</div>
</body>
</html>
Now , Modify above View body content with the following
code.
<body>
<div>
Welcome to My
First MVC Application.
</div>
</body>
Now , Run apllication






