$("#languageTest").click(function () {
window.location.href = '@Url.Action("GetLanguageTestList", "UserOrgManager")';
});
如果页面之间跳转,无参数(有的需要):window.location.href='@Url.Action("方法名","controller名")';。
如果跳到方法,带参数(有的不需要):window.location.href='@Url.Action("方法名","controller名")?id='+id;
场景:
假如有几个tab需要实现跳转,即页面间跳转,则用到第一种方式。
假如要导出Excel,需要跳转到导出的方法,则可能需要带sql作为参数,则用到第二种方式。
补充:
window.location.href='@URL.Action("方法名","controller名")'和
window.location.href='/AdminManager/GetUserInfo'的效果是一样的。