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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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
Asp.net 单击数据列表中的图像_Asp.net_Image_Datalist - Fatal编程技术网

Asp.net 单击数据列表中的图像

Asp.net 单击数据列表中的图像,asp.net,image,datalist,Asp.net,Image,Datalist,我从数据库中获取的数据列表中有图像。我想能够点击一个图像,这将比带我到一个新的页面,在那里的图像将显示和图像信息将显示太多 <asp:HyperLink ID="hlnk" NavigateUrl='<%# string.Format("ViewProductDetail.aspx?Image={0}", Eval("Picture")) %>' runat="server"> &nbsp;<asp:Image ID="Image1" ru

我从数据库中获取的数据列表中有图像。我想能够点击一个图像,这将比带我到一个新的页面,在那里的图像将显示和图像信息将显示太多

<asp:HyperLink ID="hlnk" NavigateUrl='<%# string.Format("ViewProductDetail.aspx?Image={0}", Eval("Picture")) %>' runat="server">

        &nbsp;<asp:Image ID="Image1" runat="server" Height="127px" 
                ImageUrl='<%# Bind("Picture", "~/Image/{0}") %>' Width="129px" />

                </asp:HyperLink>

                <br />
        <asp:Label ID="ProductNameLabel" runat="server" 
            Text='<%# Eval("ProductName") %>' />
        <br />
        <asp:Label ID="PriceLabel" runat="server" 
            Text='<%# Eval("Price","{0:C}") %>' />



那么,我需要为ViewProductDetail.aspx编写什么代码才能检索我单击的图像的信息呢?

试试这个 根据以下步骤在查询字符串中添加ProdcutId

<asp:HyperLink ID="hlnk" NavigateUrl='<%# string.Format("ViewProductDetail.aspx?ProductId={0}", Eval("productid")) %>' runat="server">

    &nbsp;<asp:Image ID="Image1" runat="server" Height="127px" 
            ImageUrl='<%# Bind("Picture", "~/Image/{0}") %>' Width="129px" />

   </asp:HyperLink>

ViewProductDetail.aspx页面中有什么代码?你试过什么?此外,我认为ASP.NET将是一个比“图像”更有用的标记,至少添加ASP.NET标记.er当前为空><寻找一些指导我应该做什么。。
if(Request.Querystring["ProductId"] !=null && Request.Querystring["ProductId"] !="")
{
  //get product details from product id and show on page
}