Why ASP.NET MVC framework

MVC framework provides a lot of benefits for web development. The main objectives of the framework are: 1. Separation of Concerns:  MVC provides a clean, organized and efficient organization of code. It is very helpful for a web application to scale in terms of functionalities and also promotes good design pattern. 2. URL Routing Mechanism: […]

Read More

Validations in Asp.net MVC

  Data Annotations help us to validate any properties in the model in Asp.net MVC. Data annotations are nothing but attributes which can be applied on model properties. For example, in the below code snippet we have a simple Employee class with a property EmployeeCode. This EmployeeCode property is tagged with a Required data annotation attribute. Which mean EmployeeCode is […]

Read More

Creating MVC Custom Helper Methods

Inline Helper Method: We can create inline helper method using @helper tag.

and once helper has defined, we can easily use in body as follow. <div> Here are the fruits: @ListArrayItems(ViewBag.Fruits) </div>

Read More

ActionResult Types in MVC

ActionResult Types in MVC MVC Controller may have one or more method that have different type of result. ActionResults: It’s the base class of all result type and this an abstract class.  So as this is base class so it may have any below return type i.e  ViewResult, PartialViewResult and  JsonResult. Based on the requirement we […]

Read More

Routing Concepts in Asp.Net MVC

MVC Routing Concept: MVC Routing is used to eliminate needs of mapping each URL with a physical file. Routing enable us to define URL pattern that maps to the request handler. This request handler can be a file or class. Each MVC application has at least one default route. ngConfig.png” alt=”Route Configuration” width=”911″ height=”425″ /> […]

Read More