Solved

Paypal button not working with masterpage

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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