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

by mitkoka 1. Декември 2008 06:12

I have a very strange problem on my web site. I'm rewriting this url:

http://localhost:4232/PAGE/hhhhh.ASPX

to this:

http://localhost:4232//page.aspx?id=969534b0-5812-4896-bd77-7e37249ca4ba

but I'm getting this error: Cannot use a leading .. to exit above the top directory.

I've cheched everythig and finaly solve it.In the MasterPage there's a logo whitin a hyperlink:

    <asp:HyperLink ID="hypLogo" NavigateUrl="~/Default.aspx" ImageUrl="~/images/logo.gif"
                    runat="server"></asp:HyperLink>

It seams that the problem is in the addres of the logo  ImageUrl="~/images/logo.gif".When I remove the "~" it works fine. By rewriting the URL I change the relative position of the logo image. The site trys to look for the image beyond the root directory and that's the reason why this error appears.

In fact the problem dosen't exist if I just use an image server control.This <asp:Image ID="Image1" ImageUrl="~/images/logo.jpg" runat="server" /> dosn't cause any problems. It seem like it is related only to  hyper link server control.

 

Tags:

ASP.NET

Коментари

Добави коментар


(Показва вашата Gravatar икона)  

  Country flag

biuquote
  • Коментар
  • Актуален изглед
Loading