c# - 无法使用 Response.Redirect 调用不同页面 ("url",false)

标签 c# asp.net

我无法在 asp.net 中使用 Response.Redirect("url",false) 重定向到其他页面。谁能告诉我出了什么问题吗?

Response.Redirect(@"~/Pages/Dashboard.aspx", false);

最佳答案

我认为你必须输入网址,而不是文件路径。所以应该是:

Response.Redirect("/Pages/Dashboard.aspx", false);

Redirects a client to a new URL. Specifies the new URL and whether execution of the current page should terminate.

就像这里解释的那样:msdn

关于c# - 无法使用 Response.Redirect 调用不同页面 ("url",false),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32331666/

相关文章:

c# - 跟踪 .ToListing EF Linq 查询之前匹配的表达式数量

c# - 在asp.net c# 中禁用RequiredFieldValidator

c# - 使用 LINQ 优化两个列表中的比较

c# - 以任意角度从墙上弹回球?

asp.net - 如何使用 Redis Pub/Sub 数据实时更新 ASP.NET 应用程序中的 html 表?

asp.net - 在剑道 TreeView 中获取选定节点的ID

c# - 如何通过id在页面上找到控件

c# - 在 Windows 窗体中加载没有 CrystalReportViewer 的 Crystal 报表模板

c# - 在 MVC3 中使用带有表单的查询字符串

ASP.NET OLEDB 代码在 IIS7 上部署时中断