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 Finishing Our CRUD Web App Partial Views

In preparation for supporting the development of a new "Update Issue" page, the Issue form has bee

I have trouble understanding the video but I though that: @Html.Partial(_IssueForm.cshtml")_would do that..

Report.cshtml
@model IssueReporter.Models.Issue

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

<h2>@ViewBag.Title</h2>

Challenge Task 1 of 1
In preparation for supporting the development of a new "Update Issue" page, the Issue form has been moved into an _IssueForm.cshtml partial view. To keep the app running properly, in Report.cshtml add a call to the Html.Partial HTML helper method.// this is what I understood from the video
@Html.Partial("_IssueForm.cshtml")
_IssueForm.cshtml
@model IssueReporter.Models.Issue
@using IssueReporter.Models

@using (Html.BeginForm())
{
    @Html.ValidationSummary()

    <div>
        @Html.LabelFor(m => m.Name)
        @Html.TextBoxFor(m => m.Name)
    </div>

    <div>
        @Html.LabelFor(m => m.Email)
        @Html.TextBoxFor(m => m.Email)
    </div>

    <div>
        @Html.LabelFor(m => m.DepartmentId)
        @Html.DropDownListFor(m => m.DepartmentId, (SelectList)ViewBag.DepartmentsSelectListItems)
    </div>

    <div>
        @Html.LabelFor(m => m.Severity)
        @Html.RadioButtonFor(m => m.Severity,
          Issue.SeverityLevel.Minor) @Issue.SeverityLevel.Minor
        @Html.RadioButtonFor(m => m.Severity,
          Issue.SeverityLevel.Major) @Issue.SeverityLevel.Major
        @Html.RadioButtonFor(m => m.Severity,
          Issue.SeverityLevel.Critical) @Issue.SeverityLevel.Critical
    </div>

    <div>
        @Html.CheckBoxFor(m => m.Reproducible) @Html.DisplayNameFor(m => m.Reproducible)
    </div>

    <div>
        @Html.LabelFor(m => m.DescriptionOfProblem)
        @Html.TextAreaFor(m => m.DescriptionOfProblem)
    </div>

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

2 Answers

Steven Parker
Steven Parker
230,178 Points

You only need the name portion of the partial file.

So just leave off the extension (".cshtml").

Thank you. My brain is fried. Trying to work on this far too long without a break.