473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Error: Cannot use a leading .. to exit above the top directory.

When running a page I am working on, I recieve the following error:

Cannot use a leading .. to exit above the top directory.

I suspect this has something to do with the problem I posted in a recent
posting "HyperLink.NavigateUrl always adds an extra ../ when going to a
higher level directory" on Sunday, May 29, 2005 7:33 PM
However, I cannot be sure because I cannot view the generated code since it
gives the error before anything is shown, and the debug goes through all my
code with no errors until the end of the Page.Load event (it makes it
through all of the code I wrote). My Stack Trace is as follows:

[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)
System.Web.UI.WebControls.HyperLink.AddAttributesT oRender(HtmlTextWriter
writer) +58
System.Web.UI.WebControls.WebControl.RenderBeginTa g(HtmlTextWriter
writer) +17
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +17
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer)
System.Web.UI.WebControls.TableCell.RenderContents (HtmlTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.WebControls.WebControl.RenderContent s(HtmlTextWriter
writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.WebControls.Table.RenderContents(Htm lTextWriter writer)
System.Web.UI.WebControls.WebControl.Render(HtmlTe xtWriter writer) +29
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.HtmlControls.HtmlForm.RenderChildren (HtmlTextWriter writer)
+44
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTex tWriter output) +262
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +72
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +131
System.Web.UI.Page.ProcessRequestMain() +1926

What can I do about this? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
5 5116
Nathan Sokalski wrote:
When running a page I am working on, I recieve the following error:

Cannot use a leading .. to exit above the top directory.

I suspect this has something to do with the problem I posted in a recent
posting "HyperLink.NavigateUrl always adds an extra ../ when going to a
higher level directory" on Sunday, May 29, 2005 7:33 PM
However, I cannot be sure because I cannot view the generated code since it
gives the error before anything is shown, and the debug goes through all my
code with no errors until the end of the Page.Load event (it makes it
through all of the code I wrote). My Stack Trace is as follows:


You could try putting a breakpoint on Page.Load and stepping through
the method. Check in the Command Window to see what the value of that
variable is. Worse comes to worse, you can add something like this:

If YourVariable.BeginsWith("../") Then
YourVariable = Substring(YourVariable, 4)
End If

Or maybe that should be three. I can never remember if Substring is 0
based or 1 based.

Lisa

Nov 19 '05 #2
I have tried using the breakpoint on Page.Load method, and I do not get any
errors in that event and all of the variables are what I expect and want
them to be while stepping through the code. The extra ../ is not added until
the A tag is generated (which means I cannot view the value of the href
attribute through a property in the Page.Load event). Because all of the
variables and properties are what I want and expect them to be during
execution, your suggested technique of using the SubString() method would
not work in all cases because of situations. For example, look at the
following code:

myanchor.NavigateUrl="comments.aspx"

In this situation, "../" would never be removed from the beginning of the
String because it is not there to remove, yet it would still be added during
the generation of the href attribute. I was looking at the
Control.ResolveUrl method, which sounded like it might be what I wanted, but
it is a method of the Control class, and the code where I assign the
NavigateUrl property is in a separate class I have written. Any ideas?
Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

<li**@starways.net> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Nathan Sokalski wrote:
When running a page I am working on, I recieve the following error:

Cannot use a leading .. to exit above the top directory.

I suspect this has something to do with the problem I posted in a recent
posting "HyperLink.NavigateUrl always adds an extra ../ when going to a
higher level directory" on Sunday, May 29, 2005 7:33 PM
However, I cannot be sure because I cannot view the generated code since
it
gives the error before anything is shown, and the debug goes through all
my
code with no errors until the end of the Page.Load event (it makes it
through all of the code I wrote). My Stack Trace is as follows:


You could try putting a breakpoint on Page.Load and stepping through
the method. Check in the Command Window to see what the value of that
variable is. Worse comes to worse, you can add something like this:

If YourVariable.BeginsWith("../") Then
YourVariable = Substring(YourVariable, 4)
End If

Or maybe that should be three. I can never remember if Substring is 0
based or 1 based.

Lisa

Nov 19 '05 #3

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have tried using the breakpoint on Page.Load method, and I do not get any
errors in that event and all of the variables are what I expect and want
them to be while stepping through the code. The extra ../ is not added
until the A tag is generated (which means I cannot view the value of the
href attribute through a property in the Page.Load event). Because all of
the variables and properties are what I want and expect them to be during
execution, your suggested technique of using the SubString() method would
not work in all cases because of situations. For example, look at the
following code:

myanchor.NavigateUrl="comments.aspx"

In this situation, "../" would never be removed from the beginning of the
String because it is not there to remove, yet it would still be added
during the generation of the href attribute. I was looking at the
Control.ResolveUrl method, which sounded like it might be what I wanted,
but it is a method of the Control class, and the code where I assign the
NavigateUrl property is in a separate class I have written. Any ideas?
Thanks.
--


Could the problem posted below be the same problem you are having? Seems to
me to be :)

http://support.microsoft.com/default...;en-us;Q226474

Mythran

Nov 19 '05 #4
It doesn't look like it, for several reasons. First of all, the article you
mention is for ASP, not ASP.NET. Second, the error message is different (my
error message is about going above the top directory, while the article you
mention is about parent directories). And most important, the extra ../ in
my error is generated without me being told about it. The ../ in the article
is hard coded (the coder knows it is there, they type it as part of their
code). I don't think that this is the same problem I am having.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have tried using the breakpoint on Page.Load method, and I do not get
any errors in that event and all of the variables are what I expect and
want them to be while stepping through the code. The extra ../ is not
added until the A tag is generated (which means I cannot view the value of
the href attribute through a property in the Page.Load event). Because all
of the variables and properties are what I want and expect them to be
during execution, your suggested technique of using the SubString() method
would not work in all cases because of situations. For example, look at
the following code:

myanchor.NavigateUrl="comments.aspx"

In this situation, "../" would never be removed from the beginning of the
String because it is not there to remove, yet it would still be added
during the generation of the href attribute. I was looking at the
Control.ResolveUrl method, which sounded like it might be what I wanted,
but it is a method of the Control class, and the code where I assign the
NavigateUrl property is in a separate class I have written. Any ideas?
Thanks.
--


Could the problem posted below be the same problem you are having? Seems
to me to be :)

http://support.microsoft.com/default...;en-us;Q226474

Mythran

Nov 19 '05 #5
Hi Nathan

If I understand you correctly, you are creating a Hyperlink child control
inside your own control. If so you can try to add the href attribute
directly to the Hyperlink's Attributes collection instead of assigning its
NavigateUrl property. The attribute value will be rendered directly as you
specified it without any additional processing.

If you are using a Hyperlink control directly on a page, you can try to use
the MapPath method to resolve the url before assigning.

May be this will help :-)

--
Best regards,
Sergey
"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:uu**************@TK2MSFTNGP15.phx.gbl...
It doesn't look like it, for several reasons. First of all, the article
you mention is for ASP, not ASP.NET. Second, the error message is
different (my error message is about going above the top directory, while
the article you mention is about parent directories). And most important,
the extra ../ in my error is generated without me being told about it. The
../ in the article is hard coded (the coder knows it is there, they type
it as part of their code). I don't think that this is the same problem I
am having.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Mythran" <ki********@hotmail.comREMOVETRAIL> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...

"Nathan Sokalski" <nj********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I have tried using the breakpoint on Page.Load method, and I do not get
any errors in that event and all of the variables are what I expect and
want them to be while stepping through the code. The extra ../ is not
added until the A tag is generated (which means I cannot view the value
of the href attribute through a property in the Page.Load event). Because
all of the variables and properties are what I want and expect them to be
during execution, your suggested technique of using the SubString()
method would not work in all cases because of situations. For example,
look at the following code:

myanchor.NavigateUrl="comments.aspx"

In this situation, "../" would never be removed from the beginning of
the String because it is not there to remove, yet it would still be
added during the generation of the href attribute. I was looking at the
Control.ResolveUrl method, which sounded like it might be what I wanted,
but it is a method of the Control class, and the code where I assign the
NavigateUrl property is in a separate class I have written. Any ideas?
Thanks.
--


Could the problem posted below be the same problem you are having? Seems
to me to be :)

http://support.microsoft.com/default...;en-us;Q226474

Mythran


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Will Chamberlain | last post by:
I am getting the following error: Exception Details: System.Web.HttpException: Cannot use a leading .. to exit above the top directory The function that throws the error is: Public Function...
5
by: Nathan Sokalski | last post by:
When running a page I am working on, I recieve the following error: Cannot use a leading .. to exit above the top directory. I suspect this has something to do with the problem I posted in a...
2
by: moondaddy | last post by:
I have a simple sample site I'm building in asp.net 2.0. I created a master page and a default.aspx content page in the project's root directory. Then I created a subfolder called content and...
8
by: mohit | last post by:
Hi, I am creating a web application in Web Matrix on the .NET framework. I have two directories :AddUser and FormAuth in a Directory P. AddUser contains a file AddUser.aspx FormAuth contains :...
3
by: baur79 | last post by:
# python configure.py -q /usr/lib/qt-3.3/ This is the GPL version of PyQt 3.16 (licensed under the GNU General Public License) for Python 2.4.2 on linux2. Type 'L' to view the license. Type...
21
by: one2001boy | last post by:
PostMessage() function returns ERROR_NOT_ENOUGH_QUOTA after running in a loop for 700 times, but the disk space and memory are still big enough. any suggestion to resolve this problem? thanks.
2
by: aks | last post by:
Hi, I'm getting this issue "Cannot use a leading .. to exit above the top directory" when i access in my server, it is working fine in my local. We are using RewriterRule in web.config file. ...
2
by: akhilesh.noida | last post by:
I am trying to compile glibc-2.5 for ARM based board. But I am getting errors while configuring it. Please check and give your inputs for resolving this. configure command : $...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.