Solved

Paypal button not working with masterpage

Posted on 2006-06-22
3
696 Views
Last Modified: 2008-03-03
Hello, I have six paypal add to cart buttons on my aspx page that is displayed in a master page. All of the buttons work correctly except for the first button. If I copy and paste the exact button above the button that is not working the button then works as expected yet the pasted button does not. It just renders a postback.


I stripped out the aspx stuff and the content control going with pure html and the button rendars correctly.



Any help would be great!
 
 here is the page:

<%@ Page Language="VB" MasterPageFile="~/MasterPage2.master" AutoEventWireup="false" CodeFile="Store.aspx.vb" Inherits="Store" title="Thank You Vietnam Veterans" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table style="width: 100%" >
        <tr>
            <td style="width: 600px; text-align: left;">
                <strong><span style="color: #000099; font-family: Georgia">
                Thank You Vietnam Veterans Gift Shop<br />
                </span></strong></td>
        </tr>
        <tr>
            <td style="width: 600px; text-align: right;" valign="top">
                <table style="width: 600px">
                    <tr>
                        <td style="width: 300px">
                            &nbsp;<asp:Image ID="Image6" runat="server" ImageUrl="~/productGraphics/whiteT.jpg" /></td>
                        <td style="width: 300px">
                            <asp:Image ID="Image2" runat="server" ImageUrl="~/productGraphics/greyT.jpg" /></td>
                    </tr>
                    <tr>
                        <td style="width: 300px"><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="Select Size">Select Size</td><td><select name="os0"><option value="Youth SM" selected="selected">Youth SM<option value="Youth M">Youth M<option value="Adult SM">Adult SM<option value="Adult M">Adult M<option value="Adult L">Adult L<option value="Adult XL">Adult XL</select>
</td></tr></table><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" tabindex="2">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="1@msn.com">
<input type="hidden" name="item_name" value="White T-Shirt">
<input type="hidden" name="item_number" value="whiteT">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.thankyouvietnamveterans.com/purchasethankyou.aspx">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
                        </td>
                        <td style="width: 300px" valign="top">
                        <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="Select Size">Select Size</td><td><select name="os0"><option value="Youth SM" selected="selected">Youth SM<option value="Youth M">Youth M<option value="Adult SM">Adult SM<option value="Adult M">Adult M<option value="Adult L">Adult L<option value="Adult XL">Adult XL</select>
</td></tr></table><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="1@msn.com">
<input type="hidden" name="item_name" value="Grey T-Shirt">
<input type="hidden" name="item_number" value="GreyT">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.thankyouvietnamveterans.com/PurchaseThankYou.aspx">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 300px" valign="top">
                            <asp:Image ID="Image3" runat="server" ImageUrl="~/productGraphics/womanC.jpg" /></td>
                        <td style="width: 300px" valign="top">
                            <asp:Image ID="Image4" runat="server" ImageUrl="~/productGraphics/manC.jpg" /></td>
                    </tr>
                    <tr>
                        <td style="width: 300px" valign="top"><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="Select Size">Select Size</td><td><select name="os0"><option value="Medium" selected="selected">Medium<option value="Large">Large</select>
</td></tr></table><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="1@msn.com">
<input type="hidden" name="item_name" value="Women's White Polo">
<input type="hidden" name="item_number" value="womenC">
<input type="hidden" name="amount" value="25.00">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.thankyouvietnamveterans.com/PurchaseThankYou.aspx">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
                        </td>
                        <td style="width: 300px" valign="top"><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="Select Size">Select Size</td><td><select name="os0"><option value="Large" selected="selected">Large<option value="XLarge">XLarge</select>
</td></tr></table><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="1@msn.com">
<input type="hidden" name="item_name" value="Men's White Polo">
<input type="hidden" name="item_number" value="ManC">
<input type="hidden" name="amount" value="25.00">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.thankyouvietnamveterans.com/PurchaseThankYou.aspx">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
                        </td>
                    </tr>
                    <tr>
                        <td style="width: 300px">
                            <asp:Image ID="Image5" runat="server" ImageUrl="~/productGraphics/hatW.jpg" />
                        </td>
                        <td style="width: 300px" valign="top">
                            <asp:Image ID="Image1" runat="server" ImageUrl="~/productGraphics/hatG.jpg" /></td>
                    </tr>
                    <tr>
                        <td style="width: 300px; text-align: right;" valign="top"><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="One Size Fits All">White Ball Cap - One Size Fits All</td><td></td></tr></table><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="1@msn.com">
<input type="hidden" name="item_name" value="White Ball Cap">
<input type="hidden" name="item_number" value="hatw">
<input type="hidden" name="amount" value="12.00">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.thankyouvietnamveterans.com/PurchaseThankYou.aspx">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
                        </td>
                        <td style="width: 300px; " valign="top"><form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<table><tr><td><input type="hidden" name="on0" value="One Size Fits All">Grey Ball Cap - One Size Fits All</td><td></td></tr></table><input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="add" value="1">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="1@msn.com">
<input type="hidden" name="item_name" value="Grey Ball Cap">
<input type="hidden" name="item_number" value="hatG">
<input type="hidden" name="amount" value="12.00">
<input type="hidden" name="page_style" value="Primary">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="return" value="http://www.thankyouvietnamveterans.com/PurchaseThankYou.aspx">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="bn" value="PP-ShopCartBF">
</form>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypal">
        <input name="cmd" type="hidden" value="_cart" />
        <input name="business" type="hidden" value="1@msn.com" />
        <input alt="Make payments with PayPal - it's fast, free and secure!" border="0" name="submit"
            src="https://www.paypal.com/en_US/i/btn/view_cart_02.gif" type="image" />
        <input name="display" type="hidden" value="1" />
    </form>
</asp:Content>

0
Comment
Question by:gogetsome
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 16964006
Difficult to see what you are describing.  Where is the button HTML?

Bob
0
 

Author Comment

by:gogetsome
ID: 16964108
Thanks for responding Bob. I've found that the issues is in having multiple forms on a page. When I strip out the masterpage code and go with straight html it works fine. I added an extra <form></form> in the table where the button reside and they now work. probably not best practice. But, I seached for quite awhile without a solid asp.net 2.0 solution.
0
 
LVL 3

Accepted Solution

by:
mistaeverly earned 500 total points
ID: 16974351
One way would be to have multiple forms in the MasterPage with difference ContentPlaceHolders within the forms.
Like

<form id="form1">
  <asp:contentplaceholder id="placeholder1" runat="server"></asp:contentplaceholder>
</form>
<form id="form2">
  <asp:contentplaceholder id="placeholder2" runat="server"></asp:contentplaceholder>
</form>

Then, within your pages, you can place the different contents withing the different forms.  
Not sure if this is what you're looking for or not, but I hope it helps.

Chad
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now