C# ASP.NET MVC Forms Creating a Basic Form Using Strongly Typed HTML Helpers

Task 1 0f 3 In report.cshtml add model

I have added the model directive as requested And I get the Bummer: Have you removed any of the code. The question does not say anything about replacing code. I assume that later challenge will want me to replace ViewBag with model.

Report.cshtml
// add model directive using IssueReporter.Models.Issue
@Model IssueReporter.Models.Issue
{
    ViewBag.Title = "Report an Issue";
}

<h2>@ViewBag.Title</h2>

@using (Html.BeginForm())
{
    <div>
        @Html.Label("Name")
        @Html.TextBox("Name")
    </div>

    <div>
        @Html.Label("Email")
        @Html.TextBox("Email")
    </div>

    <div>
        @Html.Label("DepartmentId")
        @Html.TextBox("DepartmentId")
    </div>

    <div>
        @Html.Label("Severity")
        @Html.TextBox("Severity")
    </div>

    <div>
        @Html.Label("Reproducible")
        @Html.TextBox("Reproducible")
    </div>

    <div>
        @Html.Label("DescriptionOfProblem")
        @Html.TextArea("DescriptionOfProblem")
    </div>

    <button type="submit">Save</button>
}

1 Answer

Steven Parker
Steven Parker
204,860 Points

C# is case-sensitive.

And the "model" directive is spelled with a lower-case "m" (not "Model").

I have got to cut back on coffee. Thanks for being accurate and kind