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 trialCalvin Secrest
24,815 PointsIn IssuesController.cs update the Report POST action method to redirect the user to the Index action method after adding
In IssuesController.cs update the Report POST action method to redirect the user to the Index action method after adding the issue to the repository.
I am confused with the syntax for this challenge, please help!
using System.Web.Mvc;
using IssueReporter.Data;
using IssueReporter.Models;
namespace IssueReporter.Controllers
{
public class IssuesController : Controller
{
private IssuesRepository _issuesRepository;
public IssuesController()
{
_issuesRepository = new IssuesRepository();
}
public ActionResult Index()
{
return View();
}
public ActionResult Report()
{
var issue = new Issue();
return View(issue);
}
[HttpPost]
public ActionResult Report(Issue issue)
{
if (ModelState.IsValid)
{
_issuesRepository.AddIssue(issue);
return RedirecttoAction("Index");
}
return View(issue);
}
}
}
1 Answer
Steven Parker
231,198 PointsThose darn typos will get you!
When correctly written, "RedirectToAction" has three uppercase letters, including the second "T".
Calvin Secrest
24,815 PointsCalvin Secrest
24,815 PointsLol... thanks for you assistance I didn't realize it at first.