tags:

views:

68

answers:

1

I have this code

<a href="~Home.aspx">
<img style="float:left;margin-left:1px;" src=~img/head/acasa.png 
        title="Acasa" />
</a>

and when I start the project , VS returns me this error "Error 38 Cannot use a leading .. to exit above the top directory."

What`s is the problem ??

This code id part of a control *ascx

+4  A: 

You need to adjust the src and quote it, and add runat="server" if you want to relatively resolve it to application root:

<img style="float:left;margin-left:1px;" 
     src="~/img/head/acasa.png" title="Acasa" runat="server" />

The same applies for the anchor:

<a href="~/Home.aspx" runat="server">
Nick Craver
doesn`t work , I have same error
Alynuzzu
@Alynuzzu - Then your error isn't here, it's something that starts with a `src="../"` or `href="../"` most likely elsewhere, a stylesheet or javascript include maybe?
Nick Craver