What is data action and View Base Action?

Feb 6, 2012 at 1:50 AM
Edited Feb 6, 2012 at 1:56 AM


Very confused:

This approach is beneficial when you expect multiple types of clients (for example, a web client and a Microsoft Silverlight® browser plug-in) to use the data actions, but only the web client to use the view-based actions.

View base is JavaScript or jQuery.

Data Action is Controller's method.

Am I right?

Feb 6, 2012 at 9:03 PM
Edited Feb 6, 2012 at 9:03 PM


Based on my understanding, these concepts refer to different return types of a controller method, also called action method.

  • Data actions: actions that support returning a particular format in ASP.NET MVC, like a JsonResult, ContentResult, or FileResult
  • View-based actions: actions that return the HTML structure (e.g ViewResult)

Therefore, in ASP.NET MVC you can write action methods that return a variety of types to be used in your views to obtain data for AJAX interactions. Most common types are string and ActionResult, but there are also particular formats like JsonResult which returns its values as JSON serialized data. Allowing the returned data to be easily used in client-side as appropriate.


Agustin Adami

Feb 8, 2012 at 12:31 AM


Thank you very much.