Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Returning a string literal from a controller action method is unusual. An action method typically returns one of the MVC action result types. Let’s see how to do that.
Follow Along
To follow along commiting your changes to this course, you'll need to fork the aspnet-comic-book-gallery repo. Then you can clone, commit, and push your changes to your fork like this:
git clone <your-fork>
cd aspnet-comic-book-gallery
git checkout tags/v2.4 -b using-action-result-types
Additional Learning
For more information on the .NET types used in this video, see these MSDN pages:
-
ActionResult class (from which both
ContentResult
andRedirectResult
derive) - DateTime Structure
This Stack Overflow question will show you how to disable the Diagnostic Tools in Visual Studio.
Keyboard Shortcuts
-
F12
- Go To Definition -
ALT+F12
- Peek Definition
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up