我需要做这样的事情。使用保存在数据库c中的图像路径检索图像#
我尝试使用switch语句,这是结果
现在,我尝试了不同的方法。我在数据库中保存了图像的文件路径。然后从数据库中检索的文件路径,这样它会显示对应的图像,这是结果
而不是显示它显示来自数据库中的图像路径的图像。我该如何解决这个问题?
这里是我的代码:
_DeliveryDetailsPartial
<h5 style="text-transform:uppercase; padding-left:5px; margin-top:10px; font-weight:bold">Payments Accepted</h5>
@foreach (StoreAcceptedPayment payment in Model.Item4)
{
<span class="col-md-3">@Html.DisplayFor(model => payment.ImgPath)</span>
}
DeliverController
public ActionResult GetStoreDetails(string id)
{
var store = new Tuple<List<Store>, List<StoreHour>, List<StoreHour>, List<StoreAcceptedPayment>>
(_repo.GetStore(int.Parse(id)), _repo.GetStoreHourByDay(dayOftheWeek), _repo.GetStoreHourByID(int.Parse(id)), _repo.GetAcceptedPayment(int.Parse(id)));
return View(store);
}
在此先感谢..
是否可以帮助你吗? – Aravindan
yay!谢谢.. :) – aianLee