我试图将动态数据加载到@ ajax.actionlink
<tr ng-repeat="child in row.child" ng-if="row.visible" class="expand-wrapper">
<td>
@Ajax.ActionLink("{{child.contractname}}", "home", "index", new { value = "{{child.contractId}}" }, new AjaxOptions { HttpMethod = "POST", OnSuccess = "window.location.reload()" })
</td>
</tr>
链接文本数据呈现正常,但value = "{{child.contractId}}"
根本不呈现。它给了我url = someurl/home?value=%7B%7Bchild.contractId%7D%7D
答案 0 :(得分:1)
自己找到答案。
<a href="@Url.Action("Index", "Home")/{{child.contractId}}" target="_self">Index</a>
答案 1 :(得分:0)
您不能以这种方式使用MVC Html Helper,因为您的代码是在服务器端生成的。并且花括号转换为%7B 这应该有帮助
<a data-ajax="true" data-ajax-method="POST" data-ajax-success="window.location.reload()" href="/index/home?value={{child.contractname}}">{{child.contractname}}</a>