Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# ASP.NET MVC Basics Controllers Using Action Result Types

I believe I am doing everything right and I can't figure out what is the issue.

It says in the Detail method are you returning a call to the content and I feel like I am.

VideoGamesController.cs
using System.Web.Mvc;

namespace Treehouse.Controllers
{
    public class VideoGamesController : Controller
    {
        public ActionResult Detail()
        {
            return new ContentResult ()
            {
                Content = "Welcome to the Video Game Detail page"
            };

        }
    }
}

1 Answer

Steven Parker
Steven Parker
231,269 Points

The instructions say to "return the result of a call to the base controller's Content method.", but this code is constructing a new ContentResult object instead.

Since "Content" is a method, you'll need to pass the string as an argument, and be sure to use the exact string given in the instructions, including punctuation!