Home All Groups Group Topic Archive Search About

too many forms, what should I do?

Author
24 Jun 2009 6:28 PM
Jeff
Hi

I created an Subscribe button on the PayPal website. This button I want to
use on my website so that people must pay to see hidden content. On the
PayPal site I got this markup:

<form action="<URL>" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="xxx">
<input type="image" src="yyybtn_subscribeCC_LG.gif" border="0" name="submit"
alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="uuuu/pixel.gif" width="1" height="1">
</form>

This won't work in asp.net because it already contain a form. So I'm looking
for an workaround here... any suggestions?
Like this on:
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="xxxx"
PostBackUrl="<URL>" />
but this workaround fails, it doesn't contain the information in the hidden
fields above...

any suggestions?

Author
24 Jun 2009 9:51 PM
Juan T. Llibre
http://www.google.com/search?hl=en&q=paypal+asp.net+integration&aq=0&oq=paypal+%22asp.net&aqi=g10




Juan T. Llibre, asp.net MVP
¿ Estas probando VS 2010 y ASP.NET 4.0 ?
Regístrate (gratis) en los Foros de VS 2010 y ASP.NET 4.0, en español
http://asp.net.do/foros/forums/
=====================================================
Show quoteHide quote
"Jeff" <it_consulta***@hotmail.com.NOSPAM> wrote in message news:OnVLamP9JHA.3244@TK2MSFTNGP03.phx.gbl...
> Hi
>
> I created an Subscribe button on the PayPal website. This button I want to use on my website so that people must pay
> to see hidden content. On the PayPal site I got this markup:
>
> <form action="<URL>" method="post">
> <input type="hidden" name="cmd" value="_s-xclick">
> <input type="hidden" name="hosted_button_id" value="xxx">
> <input type="image" src="yyybtn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to
> pay online!">
> <img alt="" border="0" src="uuuu/pixel.gif" width="1" height="1">
> </form>
>
> This won't work in asp.net because it already contain a form. So I'm looking for an workaround here... any
> suggestions?
> Like this on:
> <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="xxxx" PostBackUrl="<URL>" />
> but this workaround fails, it doesn't contain the information in the hidden fields above...
>
> any suggestions?
>
Are all your drivers up to date? click for free checkup

Author
25 Jun 2009 8:04 AM
Mark Rae [MVP]
Show quote Hide quote
"Jeff" <it_consulta***@hotmail.com.NOSPAM> wrote in message
news:OnVLamP9JHA.3244@TK2MSFTNGP03.phx.gbl...

> I created an Subscribe button on the PayPal website. This button I want to
> use on my website so that people must pay to see hidden content. On the
> PayPal site I got this markup:
>
> <form action="<URL>" method="post">
> <input type="hidden" name="cmd" value="_s-xclick">
> <input type="hidden" name="hosted_button_id" value="xxx">
> <input type="image" src="yyybtn_subscribeCC_LG.gif" border="0"
> name="submit" alt="PayPal - The safer, easier way to pay online!">
> <img alt="" border="0" src="uuuu/pixel.gif" width="1" height="1">
> </form>
>
> This won't work in asp.net because it already contain a form.

Yes it will. In an ASP.NET aspx page, it is possible to have only one
*server-side* form i.e. <form runat="server" ..... /> You can have as many
client-side forms (like the one above) as you like.


> So I'm looking for an workaround here...

No workaround is required.

1) Go here: http://www.sanctuaryrig.co.uk/merch/default.aspx

2) Click one of the "Add to cart" link

3) Click one of the "View cart" links

4) Select a delivery location

5) Click the "Proceed to checkout" button

6) View source. You'll notice the two forms - the server-side one
(aspnetForm) and the client-side one (frmPayPal). The "Proceed to checkout"
button is part of the client-side form - if you click it, you will be taken
to a secure PayPal page. Obviously, you don't have to go as far as
purchasing an album but, if you did, after the transaction you would be
returned to a "Thank you " page on the Sanctuary Rig website. This is how
this particular PayPal integration method works - there are several others,
including a direct API into the PayPal payment gateway, but this will mean
that you will need your own SSL certificate and a more expensive PayPal
business account...


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Bookmark and Share