Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Paypal button not working with masterpage

Posted on 2006-06-22
3
Medium Priority
?
703 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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