Posts

Explain terms of MVC ?

  MVC is Model, View, Controller.       1) Model :-  Model represents data and business logic. it maintains the data of the application.                        we can create an object of the model and using that object we can store                       and retrieve data from the database        2) View :- View is User interface means UI.                    View Display data using a model to users and enable them to modify data.    3) Controller :- Controller is a request handler.  The controller handles user requests.                              a user interacts with the view. The controller renders View with                       ...

Action method in MVC

Image
                                Action Method in MVC          1)  When we create a controller in MVC it creates Default method Index which is called as                 Action method             2)  When you create a method in controller every method is public. means every action method                is public           3)  When we create an Action method we can not create a method as static.             4)  When we hit URL from the browser then it performs the MVC life cycle and finds a                controller and action method in return response to the user.           Let Understand How to create Action method in C...

ActionResult Return Type in MVC

                                ActionResult Return Type                   When we create an Action method in the controller so ActionResult  is the return type of                    method                        public class LearnController: Controller                     {                        // GET: Learn                         public ActionResult Index()                         {                             ViewBag.Title = "Learn Controller"; ...

Controller in MVC

Image
                                                         Controller in MVC           1)  The controller handles user requests. so when a user hit any URL from browser controller                      handle user requests.                               2)   Controller is a class and this controller class derived from the base class               3)    In the controller class, it contains a method which is an action method. so every public                      The action method in the controller class is accessible from a browser.            ...

Routing in Asp.Net MVC with example

                       Routing in Asp.Net MVC with example           Routing is defined in the RegisterRoutes method inside the RouteConfig class.         this RouteConfig class resides in App_Start Folder.                public static void RegisterRoutes(RouteCollection routes)         {             routes.IgnoreRoute("{resource}.axd/{*pathInfo}");             routes.MapRoute(                 name: "Default",                 url: "{controller}/{action}/{id}",                 defaults: new { controller = "Account", action = "Index", id = UrlParameter.Optional }             );           ...

ASP.NET MVC Architecture

Image
                             ASP.NET MVC Architecture  MVC is Model, View, and controller. it separates an application into three-part     1)Model 2) View 3) Controller.  Let understand each part in details below:-  1)  Model :-  Model represents data and business logic. it maintains the data of the application.                        we can create an object of the model and using that object we can store                        and retrieve data from the database        2)  View :- View is User interface means UI.                     View Display data using a model to users and enable them to modify data.    3)  Controller :- Controller is a request handler....

ASP.NET MVC Folder Structure

Image
                            ASP.NET MVC Folder Structure                                Hello, you will learn the folder structure of MVC . when we create a new MVC application it creates a default structure below:-                  Let Understand Folder                              1) App_Data :- This folder contains files like .mdf file  , XML file , localdb etc.               2) App_Start:- This folder contains files like a bundle.config.cs, filter.config.cs ,                                          RouteConfig.cs . this three file in MVC 5  include by default. ...

How To Create an MVC application in Visual Studio 2019

Image
                                     Below is a step to create an MVC project.    1) First, need visual studio so before creating MVC application first install Visual studio        https://visualstudio.microsoft.com/downloads/    you can install the latest version from the above URL.  2) Open Visual Studio 2019 and click on create a new project.       3)  After creating a new project. it showing multiple templates. you can choose any template       based on your requirement.                     1) Search ASP.NET in search box        2) Find ASP.NET Web application. if you want to develop an application in VB(visual basic)            then select VB  template if you want to develop an application in C#  ...