[英]Navigating out of folder to a specific page.aspx
I have an ASPX within a Folder within a Folder. 我在文件夹内的文件夹内有一个ASPX。
Administration > Users > Add.aspx
I want to navigate out of these 2 folders, and go to the Default.aspx page. 我要浏览这2个文件夹,然后转到Default.aspx页。
I'm using this : Navigation.NavigateTo("../default.aspx", true);
我正在使用: Navigation.NavigateTo("../default.aspx", true);
But this only gets me out of Users
Folder. 但这只会使我脱离“ Users
文件夹”。
How can I navigate out of the Administration
Folder? 如何浏览出Administration
文件夹?
[SOLVED] Beejee answered. [已解决] Beejee回答。
You will have to use multiple "../" for each folder you want to skip. 对于每个要跳过的文件夹,您将必须使用多个“ ../”。 So in your case it would be: 因此,在您的情况下,它将是:
Navigation.NavigateTo("../../default.aspx", true);
But if you are talking about navigating to another page from inside the code you could use: 但是,如果您要谈论的是从代码内部导航到另一个页面,则可以使用:
Response.Redirect("~/default.aspx");
The "~" will go to the root of your site. “〜”将转到您网站的根目录。 So if your default page is in the root of your site it is better to use "~" than using the "../" 因此,如果您的默认页面位于网站的根目录中,则使用“〜”比使用“ ../”更好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.