A视图传id到B视图
$.ajax({ type: 'POST',url: "/Account/A" data: { 'f': f},async: true,success: function (data) { if (data.IsOK) { $('#text').html("<font><b>" + data.Message + "</b></font>"); window.location.href = "/Account/B?id="+data.id+""; } else { $('#text').html("<font><b>" + data.Message + "</b></font>"); } } })
B视图接收A传过来的“id”
@{ Layout = null; ViewBag.Title = "ajax传值"; var id = Context.Request["id"]; }原文链接:https://www.f2er.com/ajax/161207.html