Action Type

Let's make some modification to the code.

public ActionResult Detail()
{
    if (DateTime.Today.DayOfWeek == DayOfWeek.Monday)
    {
        return Redirect("/");
    }

    return Content("Hello from ComicBookController");
}

It will check current day and check it with Monday, if yes, it will redirect our navigation to default path.

We are still returning a string for our content. We could add some HTML tags. But, as stated in the beginning class, controller shouldn't be concerned with the presentation of our content.

Controllers are coordinators. They are responsible for coordinating the specific actions that need to be performed.

results matching ""

    No results matching ""