如何使用mvc在图像上拥有多个链接

时间:2011-06-07 14:14:49

标签: html image model-view-controller

我有一个图像,所以当点击图像的顶部时,它应该到达某个网址,当点击图像的底部时它应该转到其他网站,我知道如何用html区域做到这一点标签,但我不知道如何在mvc 3中实现这一点。任何帮助都将受到高度赞赏。

编辑:

<img src="/content/images/content/Insurance-Graphic.jpg" alt="Trackday insurance" usemap="#insurancemap" />
        <map name="insurancemap">
          <area shape="rect" coords="0,0,275,140" alt="TrackDay Insurance" href="http://www.competition-car-insurance.co.uk/form_track_day.htm" target="_blank" />
          <area shape="rect" coords="275,140,0,0" alt="Reis Insurance" href="http://www.reis.co.uk" target="_blank" />

        </map>

以上代码有效:)

1 个答案:

答案 0 :(得分:0)

mvc让您完全控制html渲染。您可以在视图中包含您的html区域。当它们是动态的时,你可以使用控制器将图像和html区域的url传递给视图。

希望有所帮助