KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have following hidden input: <input type="hidden" class="deleted" name="Deleted" data-id="@Model.Id" value="@Model.Deleted" /> I was wanting to convert this to the MVC helper HiddenFor. Got this far: @Html.HiddenFor(x => x.Deleted, new { @class="deleted" }) So that covers the class. I also need the data-id attribute and value. Tried to add the data-id as: @Html.HiddenFor(x => x.Deleted, new { @class="deleted", data-id="@Model.Id" }) Well the helper doesn't seem to like the hyphen in the data-id. So how to get it in there? Also how to get the value="@Model.Deleted" in there also?
Tags (comma-separated)
Save Edits
Cancel