Click here to Skip to main content
16,012,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am doing shopping cart project using visual studio 2010 and sql 2008 using c#. There are 3 pages

1 mobilecart

2.viewmobiledetails

3.orderedpage

in mobilecart.aspx there is a data list which contains image button so that it can show top 6 images from database. If any user clicks that image it would go to viewmobiledetails.aspx. up to here everything is working fine.

what I want is after clicking the image the viewmobiledetails.aspx should show the same image that user clicked/selected

Also when clicking buy now link orderpage.aspx should show the product selected name quantity and price
Posted

1 solution

When I use datalist , here's the code :

ASP.NET
<asp:datalist id="DataListProduct" runat="server" repeatcolumns="6" repeatdirection="Horizontal" xmlns:asp="#unknown">
        DataKeyField="product_id">
        <itemtemplate>
            <div style="padding: 10px; text-align: center;">
                <a href="viewmobiledetails.aspx?x=<%# Eval(" product_id=")%>">
                    <asp:image id="ImageImg" runat="server" height="100px" imageurl="<%# Eval("image") %>">
                        Width="100px" />
                    <h5>
                        <asp:label id="LabelName" runat="server" text="<%# Eval("name") %>"></asp:label>
                    </h5>
                    Rp.<asp:label id="LabelPrice" runat="server" text="<%# Eval("price") %>"></asp:label>
                </asp:image></a>
            </div>
        </itemtemplate>
    </asp:datalist>

I use hyperlink to redirect user to detail page. Use querystring to transfer the id or encrypt it to secure it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900