Solved

Paypal BuyNow button is not  re directing to the paypal website

Posted on 2011-09-29
5
267 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How can I build my own IDE using ASP.NET MVC? 2 43
Connection String 16 54
What display techniques for text on a video? 3 41
ebay api to see some data about my customers 2 28
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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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.
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…

785 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