-2
我可以发送到操作方法的新记录,然后用同样的方法Asp.net mvc5同样的动作POST和GET相同的方法
public class HomeController : Controller
{
[HttpGet]
[HttpPost]
public JsonResult _sendConfirmation'(string subject,string mail)
{
Some Code--Some Code---Some Code
return Json(new { Success = true, id = newCreatedMailId });
}
}
的jQuery获取id来获取新的ID
$.getJSON('/Mails/_sendConfirmation', function (comingData) { alert("success" + data); jQuery.get('/Mails/_getNewMailSendConfirmation', { id: comingData }, function (data) { jQuery('#myModal').modal('show'); jQuery('#myModal .modal-body').html(data); });
enter code here
你的代码在某种程度上失败了吗?当你尝试*时会发生什么?你在尝试什么? – David
我在浏览器控制台中收到此错误:2:6133/Mails/_sendConfirmation加载资源失败:服务器响应状态为404(未找到) –
然后找不到请求的资源。要求什么? – David