从子文件夹访问aspx页面到文件夹aspx页面外的问题 [英] probelm from accessing an aspx page from a subfolder to an outside the folder aspx page

查看:93
本文介绍了从子文件夹访问aspx页面到文件夹aspx页面外的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我创建了一个文件夹Admin,其中我创建了一个包含aspx页面的子文件夹....当我访问这些文件夹之外的页面时,它显示一个错误,需要页面不退出。 PLZ帮助我......

这两个页面都有不同的母版页。

hello, i made a folder Admin in which i made another subfolder that consists on a aspx pages....when i access a page that is outside these folders thus it shows me an error that required page does not exit. plz help me...
and both these pages have different master pages.

推荐答案

使用相对URL。就这样。检查你的相对路径是否正确。



-SA
Use relative URLs. That's all. Checkup that your relative path is correct.

—SA


你需要使用RelativeURls作为谢尔盖提到并且只是为了获得更多信息,你可以参考下面的例子:



You need to use RelativeURls as Sergey mentioned and only for more information you can refer the following example:

Website
    AdminFolder
        SuperAdminFolder
            Page2.aspx
        Page3.aspx
    UserFolder
        SuperUserFolder
            Page5.aspx
        Page4.aspx
    Page1.aspx







要从Page2访问Page3,您可以使用../Page3.aspx作为路径

要从Page2访问Page1,您可以使用〜/ Page1.aspx作为路径

要从Page2访问Page5,您可以使用../../Users/SuperUser/ Page5.aspx或〜/ Users / SuperUser / Page5.aspx作为路径



基本上您可以使用以下符号来访问您的页面:



。文件的当前物理目录(例如aspx)正在执行

..父目录

〜应用程序根目录的物理路径




To access to Page3 from Page2 you can use "../Page3.aspx" As the path
To access to Page1 from Page2 you can use "~/Page1.aspx" As the path
To access to Page5 from Page2 you can use "../../Users/SuperUser/Page5.aspx" or "~/Users/SuperUser/Page5.aspx" As the path

Basically you can play with following symbols to access your page :

"." the current physical directory of the file (e.g. aspx) being executed
".." The parent directory
"~" The physical path to the root of the application


这篇关于从子文件夹访问aspx页面到文件夹aspx页面外的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆