Cannot use a leading ../ to exit above the top directory












39















I have a asp.net web site with it we have admin area with login page for admin only and all site is allowed for all - i need to ask how to define the right security configuration for it as i get this error



Cannot use a leading .. to exit above the top directory. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
System.Web.Util.UrlPath.ReduceVirtualPath(String path) +8862087
System.Web.Util.UrlPath.Reduce(String path) +52
System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +214
System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +180
System.Web.UI.WebControls.Image.AddAttributesToRender(HtmlTextWriter writer) +68
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


my configuration file :



 <authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" protection="All" loginUrl="Admin/LoginPage.aspx" path="/" enableCrossAppRedirects="true">
</forms>
</authentication>
<authorization>
<deny users="*" />
</authorization>




















share|improve this question

























  • What is the request that causes this?

    – R. Martinho Fernandes
    Feb 14 '10 at 18:46
















39















I have a asp.net web site with it we have admin area with login page for admin only and all site is allowed for all - i need to ask how to define the right security configuration for it as i get this error



Cannot use a leading .. to exit above the top directory. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
System.Web.Util.UrlPath.ReduceVirtualPath(String path) +8862087
System.Web.Util.UrlPath.Reduce(String path) +52
System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +214
System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +180
System.Web.UI.WebControls.Image.AddAttributesToRender(HtmlTextWriter writer) +68
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


my configuration file :



 <authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" protection="All" loginUrl="Admin/LoginPage.aspx" path="/" enableCrossAppRedirects="true">
</forms>
</authentication>
<authorization>
<deny users="*" />
</authorization>




















share|improve this question

























  • What is the request that causes this?

    – R. Martinho Fernandes
    Feb 14 '10 at 18:46














39












39








39


4






I have a asp.net web site with it we have admin area with login page for admin only and all site is allowed for all - i need to ask how to define the right security configuration for it as i get this error



Cannot use a leading .. to exit above the top directory. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
System.Web.Util.UrlPath.ReduceVirtualPath(String path) +8862087
System.Web.Util.UrlPath.Reduce(String path) +52
System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +214
System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +180
System.Web.UI.WebControls.Image.AddAttributesToRender(HtmlTextWriter writer) +68
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


my configuration file :



 <authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" protection="All" loginUrl="Admin/LoginPage.aspx" path="/" enableCrossAppRedirects="true">
</forms>
</authentication>
<authorization>
<deny users="*" />
</authorization>




















share|improve this question
















I have a asp.net web site with it we have admin area with login page for admin only and all site is allowed for all - i need to ask how to define the right security configuration for it as i get this error



Cannot use a leading .. to exit above the top directory. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
System.Web.Util.UrlPath.ReduceVirtualPath(String path) +8862087
System.Web.Util.UrlPath.Reduce(String path) +52
System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +214
System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +180
System.Web.UI.WebControls.Image.AddAttributesToRender(HtmlTextWriter writer) +68
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266


my configuration file :



 <authentication mode="Forms">
<forms name=".ASPXFORMSAUTH" protection="All" loginUrl="Admin/LoginPage.aspx" path="/" enableCrossAppRedirects="true">
</forms>
</authentication>
<authorization>
<deny users="*" />
</authorization>

















asp.net .net security url configuration






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 18 '15 at 11:10









Majid

8,131857101




8,131857101










asked Feb 14 '10 at 18:43







user186816




















  • What is the request that causes this?

    – R. Martinho Fernandes
    Feb 14 '10 at 18:46



















  • What is the request that causes this?

    – R. Martinho Fernandes
    Feb 14 '10 at 18:46

















What is the request that causes this?

– R. Martinho Fernandes
Feb 14 '10 at 18:46





What is the request that causes this?

– R. Martinho Fernandes
Feb 14 '10 at 18:46












8 Answers
8






active

oldest

votes


















55














What this means is that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.



You must have something like:



<asp:Image ImageUrl="..foo.jpg" />


But since the page itself is in the root folder of the website, it cannot refer to content one level up, which is what the leading .. is doing.






share|improve this answer





















  • 5





    How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

    – John K
    Oct 27 '16 at 18:19






  • 1





    @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

    – Matthew Lock
    Oct 5 '17 at 7:53



















15














You can use ~/img/myImage.png instead of ../img/myImage.png to avoid this error in ASP.NET pages.






share|improve this answer

































    9














    You have an image or a favicon link of the style ="../" somewhere, that if the "../" were valid, would go beyond the top of the site, like this:



    Image:



    http://example.com/Images/test.jpg


    Page



    http://example.com/Pages/test.aspx


    Valid on that page: ../Images/test.jpg

    Would throw an error: ../../Images/test.jpg






    share|improve this answer

































      2














      It means that one of the paths has a ".." at the beginning of it that would result in exiting the web site's root folder hierarchy. You need to google "asp.net relative paths" or something like that to help you with your problem.



      BTW, a hint to where the problem is is included in the exception page that you saw. It will actually tell you what file it found the problem in.



      To head off future occurences of this exception, do a search in the entire solution for this string: "../". If you find any of those in files in the root path of your web site, address them.






      share|improve this answer































        2














        In my case it turned out to be commented out HTML in a master page!



        Who knew that commented out HTML such as this were actually interpreted by ASP.NET!



        <!--
        <link rel="icon" href="../../favicon.ico">
        -->





        share|improve this answer































          0














          I moved my project from "standard" hosting to Azure and get the same error when I try to open page with url-rewrite. I.e. rule is :



          <add key="/iPod-eBook-Creator.html" value="/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR" />


          try to open my_site/iPod-eBook-Creator.html and get this error (page my_site/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR can be opened without any problem).



          I checked the fully site - never used .. to "level up"






          share|improve this answer































            0














            I had such a problem and the answer, although frustrating to find, was solved by doing a search on the offending page for the ".." in the error message. I am using Visual Studio Express and the solution was changing "../../Images/" to "~/Images/" . Hopefully this will help someone.






            share|improve this answer































              0














              I had the problem occur on my system in a very strange way. In my system customers create products that sit inside a directory structure of product categories. So ProductA might sit in the folder CategoryInner inside the folder CategoryOuter. I had just added a feature where my URL would show the category nesting on the URL thusly:



              http://www.somedomain.com/product/CategoryOuter/CategoryInner/ProductA.aspx



              Obviously the nesting on the URL was just for SEO purposes (and to show the user what category their product was sitting in. But when I used ResolveClientUrl on some URLs that used to work, it must've been confused by the extra fake pathing. The error message was popping up in the debugger on some line that was never the problem so it took me quite some time to figure out what was going on. I wnet through and removed all of my ResolveClientUrl calls that acted on anything that didn't start with a ~ and made the rest of the paths absolute paths.






              share|improve this answer






















                protected by Community Jul 6 '17 at 7:18



                Thank you for your interest in this question.
                Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                Would you like to answer one of these unanswered questions instead?













                8 Answers
                8






                active

                oldest

                votes








                8 Answers
                8






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                55














                What this means is that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.



                You must have something like:



                <asp:Image ImageUrl="..foo.jpg" />


                But since the page itself is in the root folder of the website, it cannot refer to content one level up, which is what the leading .. is doing.






                share|improve this answer





















                • 5





                  How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

                  – John K
                  Oct 27 '16 at 18:19






                • 1





                  @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

                  – Matthew Lock
                  Oct 5 '17 at 7:53
















                55














                What this means is that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.



                You must have something like:



                <asp:Image ImageUrl="..foo.jpg" />


                But since the page itself is in the root folder of the website, it cannot refer to content one level up, which is what the leading .. is doing.






                share|improve this answer





















                • 5





                  How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

                  – John K
                  Oct 27 '16 at 18:19






                • 1





                  @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

                  – Matthew Lock
                  Oct 5 '17 at 7:53














                55












                55








                55







                What this means is that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.



                You must have something like:



                <asp:Image ImageUrl="..foo.jpg" />


                But since the page itself is in the root folder of the website, it cannot refer to content one level up, which is what the leading .. is doing.






                share|improve this answer















                What this means is that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.



                You must have something like:



                <asp:Image ImageUrl="..foo.jpg" />


                But since the page itself is in the root folder of the website, it cannot refer to content one level up, which is what the leading .. is doing.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jan 19 '14 at 6:29









                Majid

                8,131857101




                8,131857101










                answered Feb 14 '10 at 18:51









                Adam RalphAdam Ralph

                24.1k45059




                24.1k45059








                • 5





                  How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

                  – John K
                  Oct 27 '16 at 18:19






                • 1





                  @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

                  – Matthew Lock
                  Oct 5 '17 at 7:53














                • 5





                  How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

                  – John K
                  Oct 27 '16 at 18:19






                • 1





                  @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

                  – Matthew Lock
                  Oct 5 '17 at 7:53








                5




                5





                How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

                – John K
                Oct 27 '16 at 18:19





                How does one go about tracking down which files have the issue in a large website? The immediate output does not seem to provide specifics.

                – John K
                Oct 27 '16 at 18:19




                1




                1





                @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

                – Matthew Lock
                Oct 5 '17 at 7:53





                @JohnK you have to resort to the [binary chop](wiki.c2.com/?BinaryChop ) for the page that is reported in the stack trace (and any master pages used): Chop out the first half of your program. Do things still screw up? If so, the problem must be in the second half. Otherwise it's likely in the first. Verify that. Now take the half where you know the problem lies and chop out half of it. Repeat until you say AhHa, or you discover an EnvironmentProblem

                – Matthew Lock
                Oct 5 '17 at 7:53













                15














                You can use ~/img/myImage.png instead of ../img/myImage.png to avoid this error in ASP.NET pages.






                share|improve this answer






























                  15














                  You can use ~/img/myImage.png instead of ../img/myImage.png to avoid this error in ASP.NET pages.






                  share|improve this answer




























                    15












                    15








                    15







                    You can use ~/img/myImage.png instead of ../img/myImage.png to avoid this error in ASP.NET pages.






                    share|improve this answer















                    You can use ~/img/myImage.png instead of ../img/myImage.png to avoid this error in ASP.NET pages.







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Feb 28 '17 at 4:12

























                    answered Aug 20 '13 at 7:58









                    MajidMajid

                    8,131857101




                    8,131857101























                        9














                        You have an image or a favicon link of the style ="../" somewhere, that if the "../" were valid, would go beyond the top of the site, like this:



                        Image:



                        http://example.com/Images/test.jpg


                        Page



                        http://example.com/Pages/test.aspx


                        Valid on that page: ../Images/test.jpg

                        Would throw an error: ../../Images/test.jpg






                        share|improve this answer






























                          9














                          You have an image or a favicon link of the style ="../" somewhere, that if the "../" were valid, would go beyond the top of the site, like this:



                          Image:



                          http://example.com/Images/test.jpg


                          Page



                          http://example.com/Pages/test.aspx


                          Valid on that page: ../Images/test.jpg

                          Would throw an error: ../../Images/test.jpg






                          share|improve this answer




























                            9












                            9








                            9







                            You have an image or a favicon link of the style ="../" somewhere, that if the "../" were valid, would go beyond the top of the site, like this:



                            Image:



                            http://example.com/Images/test.jpg


                            Page



                            http://example.com/Pages/test.aspx


                            Valid on that page: ../Images/test.jpg

                            Would throw an error: ../../Images/test.jpg






                            share|improve this answer















                            You have an image or a favicon link of the style ="../" somewhere, that if the "../" were valid, would go beyond the top of the site, like this:



                            Image:



                            http://example.com/Images/test.jpg


                            Page



                            http://example.com/Pages/test.aspx


                            Valid on that page: ../Images/test.jpg

                            Would throw an error: ../../Images/test.jpg







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Oct 5 '17 at 7:55









                            Matthew Lock

                            8,002764108




                            8,002764108










                            answered Feb 14 '10 at 18:51









                            Nick CraverNick Craver

                            535k11511971103




                            535k11511971103























                                2














                                It means that one of the paths has a ".." at the beginning of it that would result in exiting the web site's root folder hierarchy. You need to google "asp.net relative paths" or something like that to help you with your problem.



                                BTW, a hint to where the problem is is included in the exception page that you saw. It will actually tell you what file it found the problem in.



                                To head off future occurences of this exception, do a search in the entire solution for this string: "../". If you find any of those in files in the root path of your web site, address them.






                                share|improve this answer




























                                  2














                                  It means that one of the paths has a ".." at the beginning of it that would result in exiting the web site's root folder hierarchy. You need to google "asp.net relative paths" or something like that to help you with your problem.



                                  BTW, a hint to where the problem is is included in the exception page that you saw. It will actually tell you what file it found the problem in.



                                  To head off future occurences of this exception, do a search in the entire solution for this string: "../". If you find any of those in files in the root path of your web site, address them.






                                  share|improve this answer


























                                    2












                                    2








                                    2







                                    It means that one of the paths has a ".." at the beginning of it that would result in exiting the web site's root folder hierarchy. You need to google "asp.net relative paths" or something like that to help you with your problem.



                                    BTW, a hint to where the problem is is included in the exception page that you saw. It will actually tell you what file it found the problem in.



                                    To head off future occurences of this exception, do a search in the entire solution for this string: "../". If you find any of those in files in the root path of your web site, address them.






                                    share|improve this answer













                                    It means that one of the paths has a ".." at the beginning of it that would result in exiting the web site's root folder hierarchy. You need to google "asp.net relative paths" or something like that to help you with your problem.



                                    BTW, a hint to where the problem is is included in the exception page that you saw. It will actually tell you what file it found the problem in.



                                    To head off future occurences of this exception, do a search in the entire solution for this string: "../". If you find any of those in files in the root path of your web site, address them.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Mar 12 '14 at 9:27









                                    user3409893user3409893

                                    211




                                    211























                                        2














                                        In my case it turned out to be commented out HTML in a master page!



                                        Who knew that commented out HTML such as this were actually interpreted by ASP.NET!



                                        <!--
                                        <link rel="icon" href="../../favicon.ico">
                                        -->





                                        share|improve this answer




























                                          2














                                          In my case it turned out to be commented out HTML in a master page!



                                          Who knew that commented out HTML such as this were actually interpreted by ASP.NET!



                                          <!--
                                          <link rel="icon" href="../../favicon.ico">
                                          -->





                                          share|improve this answer


























                                            2












                                            2








                                            2







                                            In my case it turned out to be commented out HTML in a master page!



                                            Who knew that commented out HTML such as this were actually interpreted by ASP.NET!



                                            <!--
                                            <link rel="icon" href="../../favicon.ico">
                                            -->





                                            share|improve this answer













                                            In my case it turned out to be commented out HTML in a master page!



                                            Who knew that commented out HTML such as this were actually interpreted by ASP.NET!



                                            <!--
                                            <link rel="icon" href="../../favicon.ico">
                                            -->






                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Oct 5 '17 at 7:49









                                            Matthew LockMatthew Lock

                                            8,002764108




                                            8,002764108























                                                0














                                                I moved my project from "standard" hosting to Azure and get the same error when I try to open page with url-rewrite. I.e. rule is :



                                                <add key="/iPod-eBook-Creator.html" value="/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR" />


                                                try to open my_site/iPod-eBook-Creator.html and get this error (page my_site/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR can be opened without any problem).



                                                I checked the fully site - never used .. to "level up"






                                                share|improve this answer




























                                                  0














                                                  I moved my project from "standard" hosting to Azure and get the same error when I try to open page with url-rewrite. I.e. rule is :



                                                  <add key="/iPod-eBook-Creator.html" value="/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR" />


                                                  try to open my_site/iPod-eBook-Creator.html and get this error (page my_site/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR can be opened without any problem).



                                                  I checked the fully site - never used .. to "level up"






                                                  share|improve this answer


























                                                    0












                                                    0








                                                    0







                                                    I moved my project from "standard" hosting to Azure and get the same error when I try to open page with url-rewrite. I.e. rule is :



                                                    <add key="/iPod-eBook-Creator.html" value="/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR" />


                                                    try to open my_site/iPod-eBook-Creator.html and get this error (page my_site/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR can be opened without any problem).



                                                    I checked the fully site - never used .. to "level up"






                                                    share|improve this answer













                                                    I moved my project from "standard" hosting to Azure and get the same error when I try to open page with url-rewrite. I.e. rule is :



                                                    <add key="/iPod-eBook-Creator.html" value="/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR" />


                                                    try to open my_site/iPod-eBook-Creator.html and get this error (page my_site/Product/ProductDetail?PRODUCT_UID=IPOD_EBOOK_CREATOR can be opened without any problem).



                                                    I checked the fully site - never used .. to "level up"







                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered Nov 10 '14 at 17:30









                                                    Oleg ShOleg Sh

                                                    2,99973781




                                                    2,99973781























                                                        0














                                                        I had such a problem and the answer, although frustrating to find, was solved by doing a search on the offending page for the ".." in the error message. I am using Visual Studio Express and the solution was changing "../../Images/" to "~/Images/" . Hopefully this will help someone.






                                                        share|improve this answer




























                                                          0














                                                          I had such a problem and the answer, although frustrating to find, was solved by doing a search on the offending page for the ".." in the error message. I am using Visual Studio Express and the solution was changing "../../Images/" to "~/Images/" . Hopefully this will help someone.






                                                          share|improve this answer


























                                                            0












                                                            0








                                                            0







                                                            I had such a problem and the answer, although frustrating to find, was solved by doing a search on the offending page for the ".." in the error message. I am using Visual Studio Express and the solution was changing "../../Images/" to "~/Images/" . Hopefully this will help someone.






                                                            share|improve this answer













                                                            I had such a problem and the answer, although frustrating to find, was solved by doing a search on the offending page for the ".." in the error message. I am using Visual Studio Express and the solution was changing "../../Images/" to "~/Images/" . Hopefully this will help someone.







                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered Aug 26 '15 at 17:26









                                                            user1830924user1830924

                                                            20117




                                                            20117























                                                                0














                                                                I had the problem occur on my system in a very strange way. In my system customers create products that sit inside a directory structure of product categories. So ProductA might sit in the folder CategoryInner inside the folder CategoryOuter. I had just added a feature where my URL would show the category nesting on the URL thusly:



                                                                http://www.somedomain.com/product/CategoryOuter/CategoryInner/ProductA.aspx



                                                                Obviously the nesting on the URL was just for SEO purposes (and to show the user what category their product was sitting in. But when I used ResolveClientUrl on some URLs that used to work, it must've been confused by the extra fake pathing. The error message was popping up in the debugger on some line that was never the problem so it took me quite some time to figure out what was going on. I wnet through and removed all of my ResolveClientUrl calls that acted on anything that didn't start with a ~ and made the rest of the paths absolute paths.






                                                                share|improve this answer




























                                                                  0














                                                                  I had the problem occur on my system in a very strange way. In my system customers create products that sit inside a directory structure of product categories. So ProductA might sit in the folder CategoryInner inside the folder CategoryOuter. I had just added a feature where my URL would show the category nesting on the URL thusly:



                                                                  http://www.somedomain.com/product/CategoryOuter/CategoryInner/ProductA.aspx



                                                                  Obviously the nesting on the URL was just for SEO purposes (and to show the user what category their product was sitting in. But when I used ResolveClientUrl on some URLs that used to work, it must've been confused by the extra fake pathing. The error message was popping up in the debugger on some line that was never the problem so it took me quite some time to figure out what was going on. I wnet through and removed all of my ResolveClientUrl calls that acted on anything that didn't start with a ~ and made the rest of the paths absolute paths.






                                                                  share|improve this answer


























                                                                    0












                                                                    0








                                                                    0







                                                                    I had the problem occur on my system in a very strange way. In my system customers create products that sit inside a directory structure of product categories. So ProductA might sit in the folder CategoryInner inside the folder CategoryOuter. I had just added a feature where my URL would show the category nesting on the URL thusly:



                                                                    http://www.somedomain.com/product/CategoryOuter/CategoryInner/ProductA.aspx



                                                                    Obviously the nesting on the URL was just for SEO purposes (and to show the user what category their product was sitting in. But when I used ResolveClientUrl on some URLs that used to work, it must've been confused by the extra fake pathing. The error message was popping up in the debugger on some line that was never the problem so it took me quite some time to figure out what was going on. I wnet through and removed all of my ResolveClientUrl calls that acted on anything that didn't start with a ~ and made the rest of the paths absolute paths.






                                                                    share|improve this answer













                                                                    I had the problem occur on my system in a very strange way. In my system customers create products that sit inside a directory structure of product categories. So ProductA might sit in the folder CategoryInner inside the folder CategoryOuter. I had just added a feature where my URL would show the category nesting on the URL thusly:



                                                                    http://www.somedomain.com/product/CategoryOuter/CategoryInner/ProductA.aspx



                                                                    Obviously the nesting on the URL was just for SEO purposes (and to show the user what category their product was sitting in. But when I used ResolveClientUrl on some URLs that used to work, it must've been confused by the extra fake pathing. The error message was popping up in the debugger on some line that was never the problem so it took me quite some time to figure out what was going on. I wnet through and removed all of my ResolveClientUrl calls that acted on anything that didn't start with a ~ and made the rest of the paths absolute paths.







                                                                    share|improve this answer












                                                                    share|improve this answer



                                                                    share|improve this answer










                                                                    answered Nov 13 '16 at 5:35









                                                                    BrettBrett

                                                                    22617




                                                                    22617

















                                                                        protected by Community Jul 6 '17 at 7:18



                                                                        Thank you for your interest in this question.
                                                                        Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).



                                                                        Would you like to answer one of these unanswered questions instead?



                                                                        Popular posts from this blog

                                                                        A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                                                                        Calculate evaluation metrics using cross_val_predict sklearn

                                                                        Insert data from modal to MySQL (multiple modal on website)