Thursday, May 4, 2017

How to create online shoping Site in ASP.NET

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     <style type="text/css">
       
        .groupSeparator
        {
         
            height: 1px;
            clear: both;
         
        }
        .itemSeparator
        {
            height: 180px;
            width: 1px;
         
            margin-top: 5px;
            margin-bottom: 5px;
            float: left;
           
        }
        .Main
        {
            width:600px;
            height:500px;
            margin:auto;
           
        }
         .productItem
        {
            width: 300px;
            float: left;
            padding: 5px;
            margin: 5px;
            text-align: center;
        }
         *
        {
            margin:0000px;
            padding:0000px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style=" width:960px; height:800px; background-color: #293955; margin:auto; text-align:center">
        <asp:ListView ID="ListView1" runat="server" GroupItemCount="2" SelectedIndex="2" DataSourceID="SqlDataSource1">
        <LayoutTemplate>
            <asp:PlaceHolder ID="groupPlaceHolder" runat="server"></asp:PlaceHolder>
        </LayoutTemplate>
        <GroupTemplate>
            <asp:PlaceHolder ID="itemPlaceHolder" runat="server"></asp:PlaceHolder>
        </GroupTemplate>
       
        <ItemTemplate>
            <div class="productItem">
                <div>
               
                    <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Pimage") %>' />
                   
                </div>
                <div>
                    <b>
                      Product Id:  <%# Eval("Pid") %></b></div>
                <div>
                   Product Name: <%# Eval("Pname") %></div>
                <div>
                    Product cost: Rs<%# Eval("Pcost") %></div>
             
                <asp:Button ID="Button1" runat="server" Text="Add To Cart" />  
                   
            </div>
        </ItemTemplate>
        <ItemSeparatorTemplate>
            <div class="itemSeparator">
            </div>
        </ItemSeparatorTemplate>
        <GroupSeparatorTemplate>
            <div class="groupSeparator">
            </div>
        </GroupSeparatorTemplate>
        </asp:ListView>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
        ConnectionString="<%$ ConnectionStrings:ExampleConnectionString5 %>"
        SelectCommand="SELECT * FROM [Bike]"></asp:SqlDataSource>
    </form>
</body>
</html>

No comments:

Post a Comment