17 May 2016 Sudhanshu Ranjan 1.03k
Difference Between ViewResult() and ActionResult() in MVC ?
I Hope you will be confused about both but I will clear your doubt.
“ActionResult is an abstract parent class from which ViewResult class has been derived”.
There are 11 different response types which can be sent to the end user. All are inherited to ActionResult class.
1. ViewResult - Renders a specified view to the response stream
2. PartialViewResult - Renders a specified partial view to the response stream
3. EmptyResult - An empty response is returned
4. RedirectResult - Performs an HTTP redirection to a specified URL
5. RedirectToRouteResult - Performs an HTTP redirection to a URL that is determined by the routing engine, based on given route data
6. JsonResult - Serializes a given object to JSON format
8. ContentResult - Writes content to the response stream without requiring a view
9. FileContentResult - Returns a file to the client
10. FileStreamResult - Returns a file to the client, which is provided by a Stream
11. FilePathResult - Returns a file to the client
Sudhanshu Kumar Ranjan | Lead Engineer at HCL Technologies | Expertise in Microsoft Technology | Author | Blogger | Programmer
Connect with him on Facebook | Google+ | LinkedIn | Twitter
- Microsft online test question for Dotnet -1
- Get manager name in employee table mostly asked in interview question
- How to save data in database using MVC in asp.net
- What is cursor in SQL Server with example.
- make bootable USB pendrive using command prompt in window
- How to setup angular 2 environment and build a project
- What is static Constructor? Explain.
- What is Interface in C#? Explain
- Factorial Number Program in C#
Leave a comment
Search In This Website
- TypeError: $(...).autocomplete is not a function
- Paging in MVC using C# with razor
- How to use CKEditor in MVC application/ Asp.net application.
- Bind dropdown in MVC using jquery with C#
- How to implement CAPTCHA in MVC 4 using C# Asp.net.
- datepicker textbox in mvc 4 using JQuery
- secure connection failed firefox fix
- How to install asp.net mvc 5 in visual studio 2012
- Bind gridview and paging example in angularjs
- Create and consume a simple WCF Restful service using AngularJs application
- Sql Server(9)
- Entity Framework(3)
- Angular Js(6)
- Web API(0)
- Web Service(1)
- Crystal Report(0)
- My SQL(5)
- Visual Studio(18)
- Knockout JS(0)
- Microsoft Office(0)
- Node JS(0)