Print Page | Close Window

Cannot use a leading ..

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=8736
Printed Date: 29 March 2026 at 10:15am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Cannot use a leading ..
Posted By: Boecky
Subject: Cannot use a leading ..
Date Posted: 10 January 2004 at 10:35am

Hello, When I'm almost finnished with mine first asp.net site, it errors

At my test server at home, it runs perfect. It's in a virual dir. (So i thought a virtual dir act like you put it in the root)

When I upload the site to my hosting (in the root) it gives me this error: see under here

I hope someone can help me... I have no idea what it is!

Server Error in '/' Application.
------------------------------------------------------------ --------------------

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.Reduce(String path) +701
   System.Web.Util.UrlPath.Combine(String basepath, String relative) +304
   System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +258
   System.Web.UI.WebControls.HyperLink.AddAttributesToRender(Ht mlTextWriter writer) +59
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlText Writer writer) +17
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +17
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextW riter writer) +44
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +263
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +72
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
   System.Web.UI.Page.ProcessRequestMain() +1929

 


------------------------------------------------------------ --------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573




Replies:
Posted By: Diep-Vriezer
Date Posted: 10 January 2004 at 12:00pm

I think you used a directory somewhere in your app, which reffers to a location higher than the root dir, which cannot be accesed.

For example, if your previous location was /MyApp/ and you want to acces a file in the root you'd use ../

Now your app is at /, so you can't use ../ or anything like that.



-------------
Gone..


Posted By: Boecky
Date Posted: 10 January 2004 at 12:20pm

yes, that's what the error says.

But what i don't understand is why it works in a virtual dir in not in a root of the site. Do i have to compile it in the root dir then?



Posted By: Diep-Vriezer
Date Posted: 10 January 2004 at 3:19pm

Maybe. Are you sure you don't make any references to folders which are higher than the root?

Or, you could try this:

  1. Create a new solution in VB.NET
  2. Add a web project (your local server)
  3. Add a web project (your remote server)
  4. Copy the files
  5. Check that no references to other directory's are made
  6. Build the solution

That's what I did in a simular situation (although I didn't get any error) and it works fine.



-------------
Gone..


Posted By: Boecky
Date Posted: 10 January 2004 at 6:14pm

after reading and checking my code for 1000 times, i found out that i  somewhere in a hyperlink control used ../../something.aspx, that's 1 time ../ too much

But it works now




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net