前端之家收集整理的这篇文章主要介绍了
mvc @Ajax.ActionLink 后台 写跳转,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
@Ajax.ActionLink
请求成功时,跳转到另外一个页面
return JavaScript("window.location = 'http://www.google.co.uk'");
// return Redirect(strUrl); 这种不行
请求失败时,弹出提示消息
return Json(new { msg = "跨系统登录失败!" });
参考:http://stackoverflow.com/questions/1538523/how-to-get-an-asp-net-mvc-ajax-response-to-redirect-to-new-page-instead-of-inser