简体   繁体   English

从文件夹中导航到特定的页面.aspx

[英]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.

相关问题 ReSharper:查找Page.aspx的用法 - ReSharper: Find usage of a Page.aspx 如果我尝试从Page.aspx重定向页面,则会出现问题 - Problem if I try to redirect page from Page.aspx Response.Redirect(“ page.aspx”)并不总是有效 - Response.Redirect(“page.aspx”) doesn't always work 如何将page.ASPX重定向到MVC5中的/ - How do I Redirect page.ASPX to / in MVC5 在文本框中按下 Enter 键时,重定向到 page.aspx - When Enter Key is pressed in a textbox, redirect to page.aspx 如何将路由http:// localhost:53244 / page.aspx?ID = 7842映射到http:// localhost:53244 / Home - How to map routes http://localhost:53244/page.aspx?ID=7842 to http://localhost:53244/Home 在给定当前URL的情况下,是否有内置的创建绝对(完全限定)url来自相对路径,例如“〜/ page.aspx”? - Is there a built-in create an absolute (fully qualified) url from a relative path such as “~/page.aspx” given the current URL? ASP.NET Web Forms - 将 Z3EB7106C3477A60E6BBF5DBFDE1DA59 方法名从 Page 发送到其他。 - ASP.NET Web Forms - Send Ajax from Page.aspx to other Different.cs/MethodName Windows Live API oauth 2.读取包含page.aspx?#access_token = fhuevhkfu3q9的查询字符串 - Windows Live API oauth 2. Reading a query string that contains page.aspx?#access_token=fhuevhkfu3q9 将aspx页面运行到Sharepoint文件夹中 - Run a aspx page into a Sharepoint folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM