Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/271.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
C# 单击缩略图时如何显示全尺寸图像?_C#_Asp.net_Image_Thumbnails - Fatal编程技术网

C# 单击缩略图时如何显示全尺寸图像?

C# 单击缩略图时如何显示全尺寸图像?,c#,asp.net,image,thumbnails,C#,Asp.net,Image,Thumbnails,我有一个车辆列表,每辆车都有自己的图像。现在缩略图正在显示图像正在显示,我想在单击缩略图时显示全尺寸图像。它从数据库(c.VehicleImage)获取图像名称。如何为imgVehicleImage创建onClick事件 <tr> <td colspan="3"> <asp:Image runat="server" ID="imgVehicleImage" /> </td> </tr> 在HTML中,对

我有一个车辆列表,每辆车都有自己的图像。现在缩略图正在显示图像正在显示,我想在单击缩略图时显示全尺寸图像。它从数据库(c.VehicleImage)获取图像名称。如何为imgVehicleImage创建onClick事件

<tr>
    <td colspan="3">
        <asp:Image runat="server" ID="imgVehicleImage" />
    </td>
</tr>

在HTML中,对缩略图和图像使用
asp:Image
,但要隐藏图像。然后单击缩略图时,隐藏缩略图并显示图像


您可以使用JQuery。请参阅以获取示例。

绑定缩略图的单击事件并动态替换图像源,或者可以添加两个div。由你决定。
if (!string.IsNullOrEmpty(c.VehicleImage))
{
    imgVehicleImage.Visible = true;
    imgVehicleImage.ImageUrl = "/thumbnail.ashx?ImgFilePath=" + ConfigurationManager.AppSettings["VehicleImageFolder"] + Company.Current.CompCode + "\\" + c.VehicleImage + @"&width=200&height=200"; ;
}