Search code examples
asp.net-core-mvctagbuilder

Asp.NET MVC 6, TagHelper "asp-for" to Model itself


Lets say I have this partial View:

@model DateTime?
<input asp-for="???" class="form-control" />

What goes to ??? to bind to the Model its self?


Solution

  • Use:

    <input asp-for="@Model" class="form-control" />