Saturday, October 27, 2018

Asp.Net MVC Tutorials About Folder Structure

Asp.Net MVC Folder Structure
Asp.Net MVC Folder Structure

Asp.Net MVC Folder Structure creates by Visual Studio. Check  " How to create the Asp.Net MVC Application". in this structure you can find the Models, Views, Controllers, App_Start, App_Data, Scripts, Content, Fonts, Properties, References, Web.Config, Global.asax files. each folder has its own significance. let's see the importance of each folder. MVC Controllers

   Controllers handle the user request from the browser and return the response back to the user as per incoming URL request. The controller is a class derived from the abstract class controller. The controller contains the public action method. it must be derived from the System.Web.Mvc.Controller Class. MVC Models MVC Model contains the all application Logic that are Business Logic, Validation Logic, Data Access Logic. it holds the data in the form of Public properties. the model class placed inside Model Folder in the Structure.

 Model Class Looks below example.
                   namespace alltechgeeks.Models
                            public class EMP
                                 public int id { get; set; }
                                 public  string name   {  get;  set;  }
                                 public  string City     {  get;  set;  }


Asp.Net MVC Views

the views are store in views folders. every controller has  one folder in views folder with same name of controller name. how many action methods are available in controller that many views are available in views folder with extension of   ".cshtml". (Razor View Engine)
 The main advantage of views are to display the data from model to view.
Shared folder in views are used to share the views, partial views and layouts  are shared among multiple views.


  This folder contains the Database related files like .mdf file, Local DB, XML files and other database related files. this files are not accessed directly in browser so this files are secured.


 this folder contains the  some configuration class files. this files plays a mainbrole while executing the application. we can find the config class files like below

  1.    RouteConfig.cs
  2.    FilterConfig.cs
  3.    BundleConfig.cs
  4.    AuthConfig.cs
Each config file has its own properties.


 This folder contains the .css files, this files are static file. And here we can place the images, icons etc. from version MVC 5 on wards, you can find default bootstrap.css and also bootstrap.min.css.


this folder contains the all java script files like bootstrap.js, bootstrap.min.js, jquery.js and jquery.min.js files etc.


Global.asax contains the code that is executed in response to session and application level events such as Application_Start, Session_Start, Application_Error, Session_End, Application_End and Application_Disposed.


it contains the application level configuration. if you want access the through the application, in that scenario you should go web.config file and declare in XML format.

                                               Asp.Net MVC  - Get Started

  1. MVC Tutorials- Get Started 
  2. Architecture
  3. First Application
  4. Folder Structure
  5. Controller
  7. Model
  8. Bundling
  9. View Bag
  10. Temp Data
  11. View Data
  12. Action Methods
  13. Action Selectors
  14. HTML Helpers
  15. Partial Views
  16. Layout View
  17. Filters
  18. Action Filters
  19. Validations
  20. Area
  21. What is Entity Framework and types  
  22. Creating Project in Database First Approach
  23. Creating Project in Code first approach
  24. Creating Project in Model Base First approach

No comments: