Skip to main content

    RedirectToRouteResult in MVC

    In this article we will learn about RedirectToRouteResult class.Object of this class represents redirection from one action method to another method within a web application. It sends HTTP 302 response to browser so browser sends another request to new action method. For example, if login is successful then user will be redirected to dashboard else […]

    Read More

    RedirectResult in MVC

    RedirectResult represents redirection from an action method to other website. Action method send http status code 302 to browser, after receiving 302 response, browser sends another request to target URL. We use Redirect() method to create and return an object of RedirectResult class. For example, from action method we want to redirect to facebook profile […]

    Read More

    FileResult in MVC

    We use FileResult when we want to return a file as a response to browser.Sometimes user may need to download specific files from application such as order details in pdf format or user guide for instructions. Now we will see the code for downloading file using FileResult. FileResult is child class of ActionResult class. In […]

    Read More

    ContentResult in MVC

    Please read my articles First MVC Application and ActionResult in MVC before proceeding further in this article. In this article we will learn about ContentResult. We can use ContentResult if we want to return some content along with content-type from an action method. The content-type can be plain text, html, css or xml. For example […]

    Read More

    ActionResult in MVC

    ActionResult is a parent class that represents result of an action method. After execution of action method, it will return an object of ActionResult class or a child class derived from ActionResult class. In ASP.Net MVC, it is recommended to specify return type of every action method as ActionResult. You can return any type of […]

    Read More

    Bootstrap in MVC

    Please see my article ‘First MVC Application’ before reading this article because this article is dependent on my previous article. We will use CSS framework ‘Bootstrap’ in our MVC project. In this article we will learn to install bootstrap package in MVC project. We will add nuget package of Bootstrap. Bootstrap package has some dependency […]

    Read More

    MVC Controller

    Controller is a class that defines execution flow in MVC application.Controller receives request from browser, it calls the model and perform business logic then it calls the view to render output on UI. It is recommended to create controller class as public class.Controller class should inherit from System.Web.MVC.Controller base class This base class provides necessary […]

    Read More

    ASP.Net MVC Overview

    ASP.Net MVC is a web application framework, that gives you a powerful MVC architecture based way to build dynamic web applications, enables a clean separation of concerns and gives you full control over markup.To overcome the problems associated with ASP.Net Web Forms , Microsoft instroduced ASP.Net MVC in 2009. Main Advantages:1.Clean separation of concernWe can […]

    Read More