Question Locked

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

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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:

Could anyone tell me what going wrong here?

Regards,
Blumen

3 replies

by ravithapliyal

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

by 93961

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.

This discussion is closed to new replies.