我可以添加吗
$("#report").html('Html.Action("ReportPage", new { id = Model.GoalId })')
这里的报告是我想要放置操作结果的div的id ReportPage id是传递给ReportPage actionresult的参数
您需要使用服务器标签才能实现此目的。所以:
$("#report").html('@Html.Action("ReportPage", new { id = Model.GoalId })')
or
$("#report").html('<%= Html.Action("ReportPage", new { id = Model.GoalId }) %>')
如果这就是你的意思操作结果 ReportPage.
但如果通过操作结果 ReportPage你的意思是你的MVC操作返回的实际结果(即:视图,json ..)你必须使用这样的东西
$.get('@Html.Action("ReportPage", new { id = Model.GoalId })', function(data) {
$("#report").html(data);
});
希望这可以帮助
PS: See http://api.jquery.com/jQuery.get/ http://api.jquery.com/jQuery.get/有关 jQuery.get() 的更多详细信息
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)