<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Product.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <br /> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand="SELECT [p_id],[p_name], [brand], [p_file], [price] FROM [mobile]"> </asp:SqlDataSource> <br /> <br /> <asp:DataList ID="DataList1" runat="server" DataKeyField="p_id" DataSourceID="SqlDataSource1" RepeatColumns="4" RepeatDirection="Horizontal"> <ItemTemplate> <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl='<%#"ShowImage.ashx?p_id="+ Eval("p_id")%>' Height="150px" Width="150px" PostBackUrl='<%# String.Format("~/ProductDetails.aspx?p_id={0}", Eval("p_id"))%>' ></asp:ImageButton> /ItemTemplate> </asp:DataList> </div> </form> </body> </html>
protected void Page_Load(object sender, EventArgs e) { try { if (!IsPostBack) { string p_id= Request.QueryString["p_id"].ToString(); // after getting pat id write code to retrive product information } } catch (Exception Ex) { } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)