【发布时间】:2014-11-21 13:55:28
【问题描述】:
[HttpPost]
public JsonResult DelayReminder(string reminderId)
{
ReminderStatus rs = new ReminderStatus();
rs.BaseProps.RequesterUserInfo.UserID = SessionManager.Current.CurrentUser.UserID;
ReminderServiceHelper.InsertNewStatus(Convert.ToInt32(reminderId), rs);
return Json(apptype, JsonRequestBehavior.AllowGet); // Problem...
}
而不是 return Json(apptype, JsonRequestBehavior.AllowGet); 我该如何在下面写?
return RedirectToAction("GetLawDetail", "Law", new { _lawID = baseappid });
如果有人想看 Javascript:
$.ajax({
type: 'POST',
url: '/Reminders/DelayReminder/',
data: {
'apptype': '@ViewData["apptype"]',
'baseappid': '@ViewData["baseappid"]',
'reminderId': $("#reminderId").val(),
'ddlDelayDuration': $("#ddlDelayDuration").val()
},
dataType: 'json',
success: function (result) {
if (result != null) {
}
....
..
如何返回 Law 控制器以在 jsonresult 中获取 GetLawDetail actionresult?
【问题讨论】:
-
在json中返回url并使用js重定向
标签: c# asp.net-mvc jsonresult