Articles → ASP .NET MVC → Create Your First View In Asp.Net MVC

Create Your First View In Asp.Net MVC






View Folder




Picture showing the Views folder in the asp.net mvc project
Click to Enlarge




Add A View




  1. Right click on the sub folder inside the ‘View’ folder and click on Add → View..
  2. Picture showing the Add - View menu for adding the new view
    Click to Enlarge



  3. A pop up appears as shown in the following figure.
  4. Picture showing the popup window for entering the view name
    Click to Enlarge



  5. A new view is added in ‘Home’ folder. See the following image.
Picture showing the new view file added in the Home folder
Click to Enlarge


Add Action Method In Controller






public ActionResult Test() {
  return View();
}





Browse View




Base_URL/Sub_Folder_Name/View_Name_Without_Extension


Picture showing the view in the browser
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Sunday, October 4, 2015

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250