【发布时间】:2016-05-20 14:27:15
【问题描述】:
这是我想在点击图片时传递 id 的简单图片:
<img class="pull-right" src="~/assest/image/cross.png" data-bind="attr: { href: unfollowAction }" alt="" />
但它没有击中控制器操作方法。我在这里实现 knockout.js 以将 id 发送到取消关注操作方法,如下所示:
self.unfollowAction = location.protocol + "//" + location.host + '/Post/Unfollow?uid=' + data.PostId;
请提前告诉我 img tag helper.many many thnks 中 data-bind 的正确语法。
【问题讨论】:
标签: jquery asp.net-mvc knockout.js