Solved

Paypal BuyNow button is not  re directing to the paypal website

Posted on 2011-09-29
5
268 Views
Last Modified: 2012-05-12
On my paypal account I have created a buynow button. Copied pasted the html on my webpage but after clicking the button, Its not getting redirected to the paypal website for the payment. I have tried the button in three browsers IE firefox and chrome, created a new  buynow button  but still no luck. I am using asp.net c# on windows 7. Any ideas why it could be happening?
0
Comment
Question by:mmalik15
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:rknetwork
ID: 36816032
How about pasting a source code here?
0
 

Author Comment

by:mmalik15
ID: 36816068
here is the code thanks

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="M7Z2QNQMGJ6WS">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
0
 
LVL 6

Expert Comment

by:rknetwork
ID: 36816117
Works just fine by itself. Please paste here the source of the whole page (from the browser).

or try using this code instead:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="M7Z2QNQMGJ6WS">
<button><img src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0"></button>
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
0
 

Author Comment

by:mmalik15
ID: 36816342
I have attached the html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta charset="utf-8" />
    <meta name="cache-control" content="no-cache" />
    <meta name="language" content="en" />
    <title>Home - Life in the UK</title>
    <meta name="keywords" content="Home" />

    <meta name="description" content="Home" />
    <link href='Skins/MyCustomSkin/Button.MyCustomSkin.css' rel="stylesheet" media=all type="text/css" />
   <link type="text/css" rel="stylesheet" media="all" href='CSS/styles.css' />
    <link type="text/css" rel="stylesheet" media="all" href='CSS/ac.css' />
   


</head>


<body >
    <form method="post" action="Payment.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" />

<input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTY1NDU2MTA1Mg9kFgJmD2QWAmYPZBYCAgEPFgIeB1Zpc2libGVoZGRlxFk2uPk2QIFcEQM4l6eOERw8zIkn7Vot9TBGL7/MvA==" />
</div>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>


<div class="aspNetHidden">

	<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwLZnfyXBQK3zebFCQKE9pjfCLvZYTCNL9BOqGvWxb1mnN6LUZG9c189IcQadwLMAGaG" />
</div>
    <div id="Div1" style="padding-top: 8px;">
    </div>

    <div id="wrapp"  >
       
        <header id="header">

         <div id="TopLinksLogin" class="TopLinksStyle">
            <ul  style="list-style-type:none; font-weight:bold;">
                <li style="display:inline;">
                    <a id="lbtnRegister" class="NoUnderline" href="javascript:__doPostBack(&#39;ctl00$lbtnRegister&#39;,&#39;&#39;)">Register</a></li>
                <li style="display:inline;"> | </li>

                <li style="display:inline;">
                    <a id="lbtnLogin" href="javascript:__doPostBack(&#39;ctl00$lbtnLogin&#39;,&#39;&#39;)">Login</a></li>
            </ul>
        </div>
        
        
		<h1><a href="http://localhost/LifeInTheUK/PL/Home.aspx" style=" vertical-align:bottom;" title="Life in the UK">Life in the UK</a></h1>
		<nav>
			<ul>
				<li><a href='Home.aspx'   > Home</a></li>

				<li><a href='Register.aspx' >  Register</a></li>
				<li><a href='AboutTest.aspx'  >     About Test</a></li>
				<li><a href='Book.aspx'  >  Study meterial</a></li>
				<li><a href='FreeTest.aspx'  >    Free sample test</a></li>
                <li><a href='Testimonials.aspx'  > Customer testimonial</a></li>

			</ul>
		</nav>
	
		<div class="clear"></div>
	</header>
        <div id="MainContent" style="padding-left: 0px; border: 1px; float:left;" class="LeftColumnRegister">
            

        </div>
        <div id="Div2" style=" border: 1px; float:left;" class="RightColumnRegister">
            
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">

<input type="hidden" name="hosted_button_id" value="M7Z2QNQMGJ6WS">
<input type="image" src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal — The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>



        </div>

         <footer id="footer"  >
     
            <table   cellspacing=0px cellpadding=0px  style="font-weight: bold; text-align: center; font-family:Verdana;
                width:40%; height:60%;  padding-top:5px;  margin-left:30%; margin-right: 30%; color: White; ">
                <Br />
                <tr>

                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/Home.aspx">Home</a>
                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>
                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/Register.aspx">Register</a>

                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>
                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/FreeTest.aspx">Free Sample Test</a>
                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>

                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/Sitemap.aspx">Site Map</a>
                    </td>
                    <td style="font-weight: bold;">
                        |
                    </td>
                    <td>
                        <a href="http://localhost/LifeInTheUK/PL/contactus.aspx">Contact US</a>

                    </td>
                </tr>
                <tr>
                    <td colspan=9 align=center style="font-size:10px; word-spacing:1px; padding-top:0px;">© Copyright 2011. practicelifeintheuktest.co.uk All Rights Reserved
                    </td>
                </tr>
              
            </table>

	</footer>
          
   
    
    </div>

    </form>
</body>
</html>

Open in new window

0
 
LVL 6

Accepted Solution

by:
rknetwork earned 500 total points
ID: 36816353
Got it.
Your first <form> tag is not closed before Paypal's is opened.

    <form method="post" action="Payment.aspx" id="form1">

Move </form> from line 156 to line 30
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
E-commerce is quite a gambling world, and you should never entrust your business to a lucky chance. In order to outrun your competitors in a race to attract as many customers as possible, you need to have a well thought-out strategy under your belt.…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

820 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