Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Cannot use a leading ..
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Cannot use a leading ..

 Post Reply Post Reply
Author
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post Topic: Cannot use a leading ..
    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

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
Diep-Vriezer View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 August 2003
Location: Netherlands
Status: Offline
Points: 831
Post Options Post Options   Thanks (0) Thanks(0)   Quote Diep-Vriezer Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
Boecky View Drop Down
Groupie
Groupie
Avatar

Joined: 23 December 2002
Location: Belgium
Status: Offline
Points: 110
Post Options Post Options   Thanks (0) Thanks(0)   Quote Boecky Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.