我正在尝试使用AjaxOptions.OnSuccess来调用
javascript函数并将参数传递给它.我能够在没有问题的情况下调用没有参数的基本函数,它只是参数传递.
这是我的JS功能:
<script type="text/javascript"> function removeRow (itemId) { alert(itemId); } </script>
我在剃刀中的AjaxOptions声明:
New AjaxOptions With {.OnSuccess = "function(){removeRow(" + item.Id.ToString + ");}"}
<a data-ajax="true" data-ajax-success="function(){removeRow(3);}" href=...
知道我做错了什么吗?
谢谢!
解决方法
试试这个:
New AjaxOptions With {.OnSuccess = String.Format("removeRow({0})",item.Id) }