C# ASP.NET MVC Forms Creating a Basic Form Using Our Models

Dale Sublett
Dale Sublett
14,231 Points

Getting red squiggly lines under @Html and @ViewBag, along with "not used in the current context"

@model Treehouse.FitnessFrog.Models.Entry //this is an example of a strongly typed view using a Model directive

@{ ViewBag.Title = "Add Entry"; }


@using (Html.BeginForm()) {

<div class="row">

<div class="col-md-6">

    <div class="form-group">
        @Html.LabelFor(m => m.Date, new { @class = "control-label" }) <!--used a Lambda expresion -->
        @Html.TextBoxFor(m => m.Date, new { @class = "form-control" })