O'Reilly logo

Applied ASP.NET 4 in Context by Adam Freeman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Passing Data from the Action Method to the View

The most common result from a method is a ViewResult, causing a view to be rendered. All but the simplest of views require some form of data to operate on, and the MVC framework provides a range of different ways to pass data from the action method to a view. We have already encountered some of these techniques in previous chapters, but I'll recap them here for completeness.

images Note The three techniques that I describe next all pass data from an action method to a view for a single request. When the view has been rendered, the data is lost. The MVC framework supports session data if you want to pass ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required