my view is defined
@model BloombergGUI.Models.SecurityViewAltModel
<div class="col-md-10">
@Html.TextArea("TestArea",Model.FieldsList)
@Html.TextAreaFor(m => m.FieldsList, new {@class = "form-control"})
</div>
if the controller for this strongly typed view is defined as
public ActionResult Index()
{
return View(); //The first Html.TextArea says Model.FieldList is null
}
if it's defined as the following, then both statements in the view work.
public ActionResult Index()
{
return View(new SecurityViewAltModel());
}
Why when the view is strongly typed is Model.Property indicating Model is null but when I explicitly pass a new model() then Model.Property works fine. I thought Model was just another way of accessing the strongly typed model for the view and m=> m.property was a lambda expression for the TextBoxFor extension method used on strongly typed views.