Sunday, 30 December 2012 13:54

how to use form in another form in a web page

Written by 
Rate this item
(0 votes)

if you have a asp.net web page which is derived
from a master page then you may have trouble
using a form inside your page.It happens because
of your master page using a form.It's a little tricky
to be able to use another form which you need to use.
you have to use a javascript line for that.

the following example form codes show how to do that -

Buy- <br />
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business"
value="This email address is being protected from spambots. You need JavaScript enabled to view it." />
<input type="hidden" name="item_name"
value="Message_Encryption" />
<input type="hidden" name="amount"
value="25.00" />

<input type="hidden" name="return"
value="http://www.csharpersworld.com/ajax.aspx" />

<input type="hidden" name="cancel_return"
value="http://www.csharpersworld.com/Software.aspx">

<input type="hidden" name="custom" value="<%=UserId %>" />

<a href="javascript:theForm.__VIEWSTATE.value='';
theForm.encoding='application/x-www-form-urlencoded';
theForm.action='https://www.paypal.com/cgi-bin/webscr';
theForm.submit();">
<img src="https://www.paypal.com/en_US/i/btn/
btn_buynowCC_LG.gif" border="0"></a>

Read 1285 times
Super User

Email This email address is being protected from spambots. You need JavaScript enabled to view it.
Login to post comments