将 URL 设置为指定的字符串值

本文关键字:字符串 URL 设置 | 更新日期: 2023-09-27 17:55:13

是否可以以编程方式指定 Url 值,然后相应地导航到页面?

string url = http://localhost:4039/LRVisuals/Default.aspx;
Url.AbsolutePath = url;

将 URL 设置为指定的字符串值

您可以使用

Response.RedirectServer.Transfer导航到页面。

Response.Redirect(url);

您将在此处找到两者之间的差异。使用 Server.Transfer Page.PreviousPage 不为 null,您可以访问控制或视图状态。