I have a viewmodel as:
public class AutoAdvert
{
//
public Condition condition { get; set; }
}
But when I access it in view it gives null reference error.
<div class="editor-label">
@Html.LabelFor(model => model.condition.Tyres)
</div>
<div class="editor-field">
@Html.TextBoxFor(model => model.condition.Tyres)
</div>
Where I am paasing to view:
public ActionResult autoadvert()
{
AutoAdvert autoadvert = new AutoAdvert();
return View(autoadvert);
}