Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 8th, 2009, 11:39 PM
Authorized User
 
Join Date: Dec 2007
Location: , , Vietnam.
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default Cannot use a leading .. to exit above the top directory.

Hello everybody

I have a big issue with an error like this

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.ReduceVirtualPath(String path) +8858519
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.AddAttributesToRen der(HtmlTextWriter writer) +68
System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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(HtmlT extWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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(HtmlT extWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +19
System.Web.UI.HtmlControls.HtmlForm.RenderChildren (HtmlTextWriter writer) +163
System.Web.UI.HtmlControls.HtmlContainerControl.Re nder(HtmlTextWriter writer) +32
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTex tWriter output) +51
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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(HtmlT extWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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(HtmlT extWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTe xtWriter 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

Please help me ......

Thanks & Best regards

Phuc Hoang
  #2 (permalink)  
Old December 9th, 2009, 10:28 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Not sure what your question is here. .NET will not allow you to move out of the top level directory of the website. Say your physical website directory is this: C:\inetpub\wwwroot\website.com and then you have an image directory path that is this: C:\inetpub\wwwroot\images. You can not put an ASPX file in the website.com folder and do something like this: <img src="../images/image.jpg" /> as you are no doubt finding out. This is a security measure to prevent someone from injecting malicious code that would allow them to transverse your file system which you don't want to have happen.

hth
-Doug
__________________
===============================================
Doug Parsons
Wrox online library: Wrox Books 24 x 7
Did someone here help you? Click on their post!
"Easy is the path to wisdom for those not blinded by themselves."
===============================================
  #3 (permalink)  
Old December 9th, 2009, 09:28 PM
Authorized User
 
Join Date: Dec 2007
Location: , , Vietnam.
Posts: 59
Thanks: 9
Thanked 0 Times in 0 Posts
Default

Hello dparsons,

Thanks so much for your helping me
It work fine

Thanks & Best Regards
Phuc Hoang
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date displayed with leading space leading to validation rejection SouthendSupporter ASP.NET 3.5 Basics 3 August 5th, 2009 02:46 PM
How do I keep leading and trailing whitespaces? 2BOrNot2B XSLT 2 October 31st, 2008 11:35 AM
Leading and Kerning of Text vijay.bhaskar General .NET 0 September 26th, 2007 12:06 AM
SELECT TOP n NOT SELECTING TOP n! ibi SQL Language 8 March 30th, 2005 08:08 PM
Displaying leading whitespace djmarquette XSLT 2 January 26th, 2005 10:39 AM



All times are GMT -4. The time now is 03:47 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.