ASP.NET [HttpException (0x80004005): cannot use master .. to exit top directory.]

The following error appears when loading the page.

[HttpException (0x80004005): Unable to use leading .. to exit the top directory.]

I do not know what to do? Can anyone help me?

+1


source to share


6 answers


I assume you did something like this:

Response.Redirect("../SomePage.aspx");

      

When using relative paths, you can only navigate to pages that are in the same virtual directory as the page on which the request is being made. What you have done is called this from the page located at the top of the virtual Directory Tree. Thus, you have several options:



  • Correct your url so it doesn't point to a higher level. ie: remove../

  • Use the complete URL. those.:http://www.example.com/SomePage.aspx

  • Use IIS to set up the virtual directory at a higher level.

For option 3:

  • Open IIS Manager.
  • Go to the directory where the page is located and right click / properties.
  • On the "Virtual Directory" tab, select "Delete."
  • Close the dialog and right click / properties in the directory you want to be root.
  • In the "Virtual Directory" tab, select "Add"
+4


source


Most likely, googlebot or some other bots are killing your site.

http://www.kowitz.net/archive/2006/12/11/asp.net-2.0-mozilla-browser-detection-hole.aspx



http://todotnet.com/post/2006/07/01/Get-GoogleBot-to-crash-your-NET-20-site.aspx

the solution is to add the .browser files to your site's app_browser folder.

+1


source


I realize that this is as old as sin, but what caused me was that I had a relative image reference in the db set with .. /. When my page tried to load the ImageUrl for an image in the root directory it worked fine, but in subdirectories it hung.

Changing it to ~ fixed problem.

+1


source


It may or may not help depending on your circumstances, but I had this error last week. The solution for me was to change the Internet settings in My Project to use the local IIS server instead of the Visual Studio web server.

0


source


I managed to solve this problem by setting the cookieless attribute on the forms tag in the web.config:

<authentication>
   <forms cookieless="UseCookies" />
</authentication>

      

0


source


Apologies as this is very old, but I had this problem for several days in an MVC3 application. I kept going into my _Layout.cshtml file and removing any link to css or javascript files (I used JQuery in this app) to find the dreaded .. / link. I couldn't find it. Then I tried to work around my problem by simply dropping the redirect to the application root. It didn't work either. The stack trace on YellowScreenOfDeath gave me a hint:

[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.] System.Web.Util.UrlPath.ReduceVirtualPath(String path) +11496719 System.Web.Util.UrlPath.Reduce(String path) +171 System.Web.Configuration.**AuthenticationConfig**.GetCompleteLoginUrl(HttpContext context, String loginUrl) +218 System.Web.Security.FormsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +156 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

Bottom line, I had this in my web.config with "../" Removing this or changing the hotfix link fixed my problem.

    <authentication mode="Forms">
     <forms loginUrl="../home.aspx" timeout="2880" />
    </authentication>

      

0


source







All Articles