Question

How do I do this using Razor?

<input type="text" id="@Model.Id" name="@Model.Value">

I am trying

@Html.TextBoxFor(m=>m.Value, ?)

Any advice how to do the above input in razor?

Était-ce utile?

La solution

@Html.TextBoxFor(m => m.Value, new { id = Model.Id, name = Model.Value})
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top