tags:

views:

1719

answers:

5

I am getting the following error while loading a page.

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

No idea what to do ? Can anyone help me ?

+2  A: 

I'm guessing you have done 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 one the page making the request is in. What you have done is called this from a page that is at the top of the Virtual Directory tree. So you have some options:

  1. Correct your url so that it does not point to a higher level. ie: remove the ../
  2. Use a full url. ie: http://www.example.com/SomePage.aspx
  3. Use IIS to set the Virtual Directory at a higher level.

For Option 3:

  1. Open up IIS manager.
  2. Go to the directory that the page is in and right click/properties.
  3. On the Virtual Directory tab select Remove.
  4. Close the dialogue and right click/properties on the directory you do want to be the root.
  5. On the Virtual Directory tab select Add
Martin Brown
A: 

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

PhilPursglove
+1  A: 

Most likely a googlebot or some other bots are killing your website.

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

solution is to add .browser files in the app_browser folder of your website.

Mafti
A: 

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

<authentication>
   <forms cookieless="UseCookies" />
</authentication>
salle55
A: 

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

Changing it to a ~ fixed the problem.

Jim