开发者

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">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜