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?

Was it helpful?

Solution

@Html.TextBoxFor(m => m.Value, new { id = Model.Id, name = Model.Value})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top