Question

Locked

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

By blumenhause ·
Hi,

I was trying to open an aspx form in VS 2005, which I created in VS 2003. But its throwing exception:

"System.Web.HttpException: Cannot use a leading .. to exit above the top directory."

But when I remove the line in aspx where I link the CSS to the page, the error vanishes. The CSS link is:
<LINK href="<%=strVersionPath%>" type=text/css rel=Stylesheet>

Could anyone tell me what going wrong here?

Regards,
Blumen

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

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

by ravithapliyal In reply to Cannot use a leading .. t ...

It means that your web page is referring to content which is in the folder one level up from your page, but your page is already in the website's root folder, so the relative path is invalid. Judging by your exception message it looks like an image control is causing the problem.

try to use Server.MapPath("~/XYZ").
It is more reliable. What will happen when u add another subdirectory... Server.MapPath("~/XYZ") willstill works.

Regards,
Ravi Thapliyal

Collapse -

Zombie Alert!!!

by Mehul Bhai In reply to Cannot use a leading .. t ...

Zombie Alert!!!
The original post is more than 3 years old and the original poster may have forgotten about the post or got the problem solved through other means.

Back to Windows Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums