无法重定向到其他页面

cannot redirect to another page

本文关键字:其他 重定向      更新时间:2023-09-26

我正在做一个Visual Studio MVC项目。

在当前视图中,我在一个函数中有代码:

window.open("../Report/ReportPage.aspx");  //open a web page on a new tab and the tab is on top
var url = '@Url.Action("IndexMain", "MainController", new { id = 1 })';  //redirect to the main page
window.location.href = url;

问题是运行函数时不显示主页,在当前视图上,有一个 Back buttton 会重定向到主页,此时当我将光标移动到按钮时,光标形状仍然是指针而不是手。 单击该按钮也没有任何响应。

谢谢。

js 函数在两个文件中。

在重定向之前,我调用了一个第三方javascript函数。那个会打开一个对话框。我相信是第三方导致了问题。删除第三方后,重定向工作正常。

谢谢你尝试帮助我。