我认为:
<% foreach (var trainingModule in Model.TrainingModules) %>
<% { %>
<tr>
<td>Training Module</td>
<td><%: trainingModule.title %></td>
<td>
<a href="javascript:ResetModule(<%: Model.User.UserId %>,<%: trainingModule.userTrainingModuleId %>);" class="button">Reset Module</a>
</td>
<td></td>
</tr>
<% } %>
和:
<script type="text/javascript">
function ResetModule(userId, userScormModuleId)
{
ans=window.confirm('Are you sure you want to reset this training module?');
if (ans==true)
{
var jqxhr = $.getJSON("<%= Url.Action("ResetModule", "Manage", new { area = "User" }) %>?userId= " + userId + " &value=" + userScormModuleId, function (data) {
});
}
else
{
}
}
然后在我的控制器中我有:
[HttpGet]
[NoCache]
public JsonResult ResetModule(int id, int userScormModuleId)
{
ZincService.ResetModule(id, userScormModuleId);
return Json(new { success = true }, JsonRequestBehavior.AllowGet);
//return RedirectToAction("UserDetails", new { id = id});
}
请问我做错了什么?我的动作没有执行 谢谢