Solved

Paypal button not working with masterpage

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

810 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