Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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: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 7-Feb-13 4:31am
Comments
Sandeep Mewara at 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 at 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)

  Print Answers RSS
0 CPallini 345
1 BillWoodruff 324
2 George Jonsson 279
3 Sergey Alexandrovich Kryukov 258
4 OriginalGriff 227
0 OriginalGriff 5,050
1 CPallini 4,225
2 Sergey Alexandrovich Kryukov 3,639
3 George Jonsson 2,911
4 Gihan Liyanage 2,386


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 7 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100