Error at <img> tag in ASP.NET
I have this code
<a href="~Home.aspx">
<img style="float:left;m开发者_StackOverflowargin-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
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">
精彩评论