Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a shopping Cart. When a customer adds to cart it will send details to paypal How can i set my add to cart button to send this information.

here is my asp,net html code.

ASP.NET
    <asp:DataList ID="dlProducts" runat="server" BackColor="White" 
        BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" CellPadding="4" 
        GridLines="Both" RepeatColumns="3" >

        <ItemTemplate>
            Product Name:
            <asp:Label ID="lblProductNane" runat="server" Text='<%# Bind("ProductName") %>'></asp:Label>
            <br />
            <asp:Image ID="Image1" runat="server" GenerateEmptyAlternateText="True" 
                Height="100px" ImageUrl='<%# "~/ProductImages/"+Eval("ImageName") %>' Width="100px" />
            <br />
            Price:
            <asp:Label ID="lblListPrice" runat="server" Text='<%# Eval("UnitPrice", "{0:C}") %>'></asp:Label>
            <br />
            Qty: 
            <br />
            <asp:LinkButton ID="lnkDetails" runat="server"  CommandArgument='<%# Bind("ProductID") %>' onclick="lnkDetails_Click">Click For Details</asp:LinkButton>
            <br />
            <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8M5EFNB9X6EH6">

<asp:ImageButton AlternateText="PayPal — The safer, easier way to pay online." ID="btnBasket" runat="server" CommandArgument='<%# Bind("ProductID") %>' OnClick="btnBasket_Click" ImageUrl="https://www.paypalobjects.com/en_GB/i/btn/btn_cart_LG.gif" />
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" I>
</form>
                        
        </ItemTemplate>
    </asp:DataList>


Many thanks
Posted
Comments
Sandeep Mewara 7-Feb-13 11:52am    
You need to elaborate on what exactly you tried that trouble you. Adding a button is not an issue, what next?
Mike Meinz 7-Feb-13 13:17pm    
When you setup your vendor agreement with PayPal didn't they provide you documentation on how to interface to them?

1 solution

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