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"> <asp:Image ID="Image1" ru
<asp:HyperLink ID="hlnk" NavigateUrl='<%# string.Format("ViewProductDetail.aspx?Image={0}", Eval("Picture")) %>' runat="server">
<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">
<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
}