I have table view binds with knockoutjs model.
<tbody data-bind="foreach: items, visible: items().length > 0">
<tr>
<td data-bind="text: Title"></td>
<td data-bind="text: Type"></td>
<td data-bind="text: Author"></td>
<td data-bind="text: Description"></td>
<td data-bind="text: Time"></td>
<td data-bind="text: Publisher"></td>
<td data-bind="text: itemId"></td>
<td>@Html.ActionLink("Edit", "Edit", "Manager", new {id = <knockoutjs model itemId value here>}, new {@class = "cssClass"})</td>
</tr>
</tbody>
I will explain the code. I have knockoutjs model which contains itemArray(items). I want to create actionlink and bind id value to (itemId) which is coming from knockoutjs model.
Hope you understand my issue
Thank you in advance
<a data-bind="attr: { 'href': '@Url.Action("Edit", "Manager")/' + itemId() }" class="cssClass">
Edit
</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With