P
Peter Afonin
Hello,
I finally figured out how to post the data to the different applications in
ASP.NET 2.0. I couldn't figure out anything better than to use the same
methods as in ASP.NET 1.1, since PostBackUrl won't work here. I'm using the
techique decribed in this article:
http://www.codeproject.com/aspnet/jsnopostback.asp
In other words, I'm adding a Javascript function like this:
<script language=javascript>
function noPostBack(sNewFormAction)
{
document.Form1.action = sNewFormAction;
document.Form1.__VIEWSTATE.name = 'NOVIEWSTATE'
}
</script>
then on Page_Load event assign these attributes to the buttons:
Me.ibPayWM.Attributes.Add("onclick",
"noPostBack('https://merchant.webmoney.ru/lmi/payment.asp');")
Me.ibPayRx.Attributes.Add("onclick",
"noPostBack('https://www.roboxchange.com/ssl/calc.asp');")
Me.ibPayRupay.Attributes.Add("onclick",
"noPostBack('http://www.rupay.com/rupay/pay/index.php');")
It works fine, however, it doesn't work if I use Master pages. Wherever I'm
trying to add this JS code, I'm always getting message that Form1 is null or
not an object. Or, if I use document.forms[0] - just don't get any data.
Do you know how to use this method with Master Pages? It should be a way.
Thank you in advance,
I finally figured out how to post the data to the different applications in
ASP.NET 2.0. I couldn't figure out anything better than to use the same
methods as in ASP.NET 1.1, since PostBackUrl won't work here. I'm using the
techique decribed in this article:
http://www.codeproject.com/aspnet/jsnopostback.asp
In other words, I'm adding a Javascript function like this:
<script language=javascript>
function noPostBack(sNewFormAction)
{
document.Form1.action = sNewFormAction;
document.Form1.__VIEWSTATE.name = 'NOVIEWSTATE'
}
</script>
then on Page_Load event assign these attributes to the buttons:
Me.ibPayWM.Attributes.Add("onclick",
"noPostBack('https://merchant.webmoney.ru/lmi/payment.asp');")
Me.ibPayRx.Attributes.Add("onclick",
"noPostBack('https://www.roboxchange.com/ssl/calc.asp');")
Me.ibPayRupay.Attributes.Add("onclick",
"noPostBack('http://www.rupay.com/rupay/pay/index.php');")
It works fine, however, it doesn't work if I use Master pages. Wherever I'm
trying to add this JS code, I'm always getting message that Form1 is null or
not an object. Or, if I use document.forms[0] - just don't get any data.
Do you know how to use this method with Master Pages? It should be a way.
Thank you in advance,