Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 从db asp.net mvc 4创建图像链接_Image_Asp.net Mvc 4_Hyperlink - Fatal编程技术网

Image 从db asp.net mvc 4创建图像链接

Image 从db asp.net mvc 4创建图像链接,image,asp.net-mvc-4,hyperlink,Image,Asp.net Mvc 4,Hyperlink,我有一个foreach循环从我的数据库中提取图像: `@foreach (var item in model) <tr> <td> <img width="50" height="50" src="@Url.Action("GetImage", "Product", new { item.ProductId})"/> </td> ...` `@foreach(模型中的变量项) ...`

我有一个foreach循环从我的数据库中提取图像:

     `@foreach (var item in model)
     <tr>
     <td>
     <img width="50" height="50" src="@Url.Action("GetImage", "Product", new { item.ProductId})"/>
     </td>
     ...`
`@foreach(模型中的变量项)
...`
我试着用“a”标签把它包起来,但我得到的只是404

    <a href = "~/..."> <img width="".../></a>

有什么想法吗

一个带有超链接的图像是我想要实现的。您单击 图像,您将进入编辑页面

好的,假设您得到了问题
Product.GetImage
中所示的图像,然后编辑页面被
Product.edit
调用,您可以得到:

<a href="@Url.Action("Edit")"><img src="@Url.Action("GetImage","Product")" /></a>


您的图像显示是否正确?得到404的URL是什么?图像很好,但是当我单击图像时,无论选择哪个URL,我都会得到一个404,它正在尝试的URL是什么?
。我尝试了其他视图,但似乎无法将其显示出来。请尝试