Category: MVC

  • Brief Journey to Asp.Net MVC Framework

    Introduction: ASP.NET MVC is a  framework for building web applications that uses the model-view-controllerpattern. Like ASP.NET Web Forms, ASP.NET MVC is also built on top of the ASP.NET Framework. This means we can use same APIs like security, state management, membership, caching,ajax etc in MVC Applications. Every ASP.NET MVC application has three parts: a model,…

  • ASP .Net MVC Error Logging Using Elmah

    ASP .Net MVC Error Logging Using Google Elmah Introduction: ELMAH is one of the popular Library to logging unhandled errors provided by Google .It’s an application wide error logging facility which can be dynamically plugged. You don’t need to recompile the code. It’s pluggable. Below I will show you how to log your errors using…

  • Asynchronous actions in MVC 5

    What does it mean? Asynchronous actions allow developers to handle more concurrent requests and can be implemented using async / await keywords. Asynchronous actions are useful in scenarios where we are performing some network operation such as calling a remote service, webapi etc. What are the Benefits? 1) It can make application to handle more…

  • Filters and Attributes in ASP.NET MVC

    Filters inject extra logic into MVC Framework request processing. They provide a simple and elegant way to implement cross-cutting concerns. This term refers to functionality that is used all over an application and doesn’t fit neatly into one place, where it would break the separation of concerns pattern. For example, if we need some action…

  • Controllers and Actions in MVC

    Every request that comes to our application is handled by a controller. The controller is free to handle the request any way it wants, as long as it doesn’t belong into the areas of responsibility of the model and view. This means that we do not put business or data storage logic into a controller,…

  • THE RAZOR VIEW ENGINE IN MVC

    View Engine is responsible for rendering the view into html form to the browser. ASP.NET MVC includes two different view engines, the newer Razor View Engine and the older Web Forms View Engine. What is Razor? The Razor view was introduced with ASP.NET MVC 3 and is the default view engine moving forward. Razor provides…

  • ViewData and ViewBag in MVC

    ASP.NET MVC provides us two options ViewData and ViewBag for passing data from controller to view. ViewData and ViewBag are almost similar. Passing data with ViewBag. The ViewBag feature allows us to define arbitrary properties on a dynamic object and access them in a view. The dynamic object is accessed through the Controller.ViewBag property. Let…

  • Creating a Simple Form with Validation Using ASP.NET MVC 4 Empty Template

    There are multiple Validation attributes available in MVC. Validation attributes comes from System.ComponentModel.DataAnnotations. Available validation attributes are- System.ComponentModel.DataAnnotations.CompareAttribute System.ComponentModel.DataAnnotations.CustomValidationAttribute System.ComponentModel.DataAnnotations.DatatypeAttribute System.ComponentModel.DataAnnotations.MaxLengthAttribue System.ComponentModel.DataAnnotations.MinLengthAttribute System.ComponentModel.DataAnnotations.RangeAttribute System.ComponentModel.DataAnnotations.RegularExpressionAttribute System.ComponentModel.DataAnnotations.RequiredAttribute System.ComponentModel.DataAnnotations.StringLengthAttribute System.Web.Security.MembershipPasswordAttribute   Let us create a simple form to request a book using MVC4 basic template. First step is to create the visual studio project. 1.  Open Visual Studio.…