I need to concatenate a url parameter onto an anchor tag. How would I go about insert it into the following template?
<tbody data-bind="foreach: Customers">
<tr class="rowEven">
<td data-bind="text: Name"></td>
<td data-bind="text: CustomerType"></td>
<td><a href="customers.aspx?customer=[CustomerAccountIDHere]">Manage</a><a href="#">Guest Admin</a></td>
</tr>
</tbody>
I tried this will no luck:
<tr class="rowEven">
<td data-bind="text: Name"></td>
<td data-bind="text: CustomerType"></td>
<td><a data-bind="attr: { href: 'customers.aspx?customer=' + CustomerAccount_BID}">Manage</a><a href="#">Guest Admin</a></td>
</tr>
Add "()" - CustomerAccount_BID() works for me.
I think the viewmodel might be the issue, here's a working example: http://jsfiddle.net/L4hUq
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