标签:
首先你要有四张图片,也就是数组中的数
public ActionResult Index()//创建视图
{
ViewBag.list =new int[] { 5, 6, 7,8 };
return View();
}
public ActionResult Get(int? id)
{
FilePathResult fpr = new FilePathResult(Server.MapPath("~/Content/imgs/"+id+".jpg"),"imgs/jpeg");
return fpr;
}
------------------Index:
@{
foreach (int item in ViewBag.list)
{
<li>@Html.ActionLink("sss" + item + "sss", "Get", "Home", new { id = item }, null) </li>
}
}
标签:
原文地址:http://www.cnblogs.com/wangxlei/p/5982892.html