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 Forms Creating a Basic Form Using HTML Helpers

I am stuck, please help

I am not understanding what the task is asking.

Report.cshtml
@{
    ViewBag.Title = "Report an Issue";
}

<h2>@ViewBag.Title</h2>

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

    <div>
        <label for="Email">Email</label>
        <input type="text" id="Email" name="Email" />
    </div>

    <div>
        <label for="DepartmentId">Department</label>
        <input type="text" id="DepartmentId" name="DepartmentId" />
    </div>

    <div>
        <label for="Severity">Severity</label>
        <input type="text" id="Severity" name="Severity" />
    </div>

    <div>
        <label for="Reproducible">Reproducible</label>
        <input type="text" id="Reproducible" name="Reproducible" />
    </div>

    <div>
        <label for="DescriptionOfProblem">Description of Problem</label>
        <textarea id="DescriptionOfProblem" name="DescriptionOfProblem"></textarea>
    </div>

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

}

1 Answer

Balazs Peak
Balazs Peak
46,160 Points

It is demanded in the exercise to use the Html.TextBox() helper function with a string parameter. Some like this:

@Html.TextBox("Name")

Thank you. That worked.