0

我制作了一个页面来填充图像并像这样写他们的名字(ASP.Net MVC):

在此处输入图像描述

这是我的代码:

<span style=" display : block">
   <a href="<%= Url.Action("EditProduct", new { id = item.Id }) %>">
   <img src='<%= Url.Action( "getImg", "Product", new  { ShopId = item.Id }) %>'   alt="" /></a>

    <%: Html.DisplayFor(modelItem => item.Name)%>
<% }%>
</span>

但我想将名称放在图像下方。我尝试了一些方法,比如 table,但我没有成功。任何想法?

4

2 回答 2

1

尝试这个:

<img src='<%= Url.Action( "getImg", "Product", new  { ShopId = item.Id }) %>' style="clear:both"  alt="" />
于 2012-11-23T10:27:05.607 回答
0

结束后添加<br />标签</a>

<span style=" display : block">
    <a href="<%= Url.Action("EditProduct", new { id = item.Id }) %>">
    <img src='<%= Url.Action( "getImg", "Product", new  { ShopId = item.Id }) %>'   alt="" /></a><br />
    <%: Html.DisplayFor(modelItem => item.Name)%> <%}%>
        </span>
于 2012-11-23T10:01:24.053 回答