Solved

Paypal button not working with masterpage

Posted on 2006-06-22
3
699 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

860 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