Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one problem...

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) +8774912
System.Web.Util.UrlPath.Reduce(String path) +52
System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +217
System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +258
System.Web.UI.WebControls.HyperLink.AddAttributesToRender(HtmlTextWriter writer) +82
System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +173
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1


Advance Thanks,
Tamimun.
Posted

It seems that in your URL you are trying to use a path that contains "..\" that mean exit to parent directory, but the current directory is the root directory for your web application!

So you have to check this URL from your code.

PS: You should show some code to can give you more details!
 
Share this answer
 
Comments
Tamimun 26-Mar-14 8:29am    
Thanks for reply..

i will try this method but not working.....

This is my sample coding...

<ul class="nav navbar-nav">
<li><a id="mytasks" runat="server" href="../ProgressClaims/QuickLinks.aspx?Redirect =0">
MY TASKS </li>
<li><a id="mynotification" runat="server" href="~/ProgressClaims/HomePage.aspx">MY
NOTIFICATIONS </li>
</ul>

Thanks,
Ansari.
Raul Iloc 26-Mar-14 8:35am    
This line <a id="mytasks" runat="server" href="../ProgressClaims/QuickLinks.aspx?Redirect =0"> have to be modified to: <a id="mytasks" runat="server" href="~/ProgressClaims/QuickLinks.aspx?Redirect =0">
Raul Iloc 26-Mar-14 9:33am    
So did you try it like I suggested above?
The error is pretty specific: "Cannot use a leading .. to exit above the top directory"
Which means you can't use a path like "..\resources\images\mypicture.jpg"

Exactly what you need to do to correct this I can't say: it could be that you weren't expecting to find you page in the top directory of your website (and should use "~\resources\images\mypicture.jpg" instead), or you might need to use Server.MapPath to convert it to a "full" windows file path.
 
Share this answer
 
Comments
Tamimun 26-Mar-14 8:31am    
Thanks for reply..

i will try this method but not working.....

This is my sample coding...

<ul class="nav navbar-nav">
<li><a id="mytasks" runat="server" href="../ProgressClaims/QuickLinks.aspx?Redirect =0"> MY TASKS </li>
<li><a id="mynotification" runat="server" href="~/ProgressClaims/HomePage.aspx">MY NOTIFICATIONS </li> </ul>

Thanks,
Ansari.
OriginalGriff 26-Mar-14 8:36am    
Look at that code: you are using two different addressing methods:
href="../ProgressClaims/QuickLinks.aspx?Redirect =0"
and
href="~/ProgressClaims/HomePage.aspx"
replace the ".." in the first one with "~" and it should fix your problem. (".." is relative to the folder containing the current page, so if you are in the root of your website you can't use it!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900