Creating ASP.NET MVC 5 Application using Entity Framework 6 and Identity with CRUD Operations on visual studio 2015 - Part -4

This is the part-4 of creating  asp.net mvc 5 application using entity framework 6.x and identity in visual studio 2015. In this tutorial you will learn how to customize the asp.net mvc 5  default template. If you have any query please feel free and post a comment right below. Other part of series:

  1. Creating ASP.NET MVC 5 project Part-1?
  2. Creating SQL Server database Part-2?
  3. Creating Entity Framework project Part-3 ?
  4. Customize the default template of ASP.NET MVC 5 Part-4 ?
  5. How to add a controller and view Part-5 ?
  6. How to Add Model Part-6 ?
  7. How to make a patient registration form Part-7?
    • Customize the default template of ASP.NET MVC 5

      • Open _Layout.cshtml from the shared folder. You can resign the whole layout html which you want to display on each and every page of your application. In layout page there is a nav bar or menu bar and render body area that specify the point at which the content from the child view is rendered relative to the layout defined. When you add a controller in the controller folder then a folder with same name of controller is created in the views folder. So all the get action method initially communicate with the same folder name if the render view is  not found then it goes to the shared folder and return the html.You can see diagram given below and hope you will understand the communication of controller with views folder as well as shared. 
      • Remove the HomeController and Home folder from views.Edit the title and remove the links (about & contact) from the nav bar.
      • After modify the layout page you can can run your application by click on the run button.
      • You  will see the following error message because of removing the  HomeController and Home folder from the views.This error will be removed by creating a controller and view as well as by redefining the Route in RouteConfig.cs file.So let's create a controller and view.

No comments:

Post a Comment

Creating ASP.NET MVC 5 Application using Entity Framework 6 and Identity with CRUD Operations on visual studio 2015 Part-9

This is the part-9 of asp.net mvc 5 series using entity framework and identity from scratch.In this tutorial you will learn how to bind a...