Posting data with Master pages

Discussion in 'ASP .Net Web Controls' started by Peter Afonin, Jan 8, 2007.

  1. Peter Afonin

    Peter Afonin Guest

    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,

    --
    Peter Afonin
     
    Peter Afonin, Jan 8, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Electrified Research
    Replies:
    5
    Views:
    2,466
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 11, 2005
  2. Doug McCann
    Replies:
    1
    Views:
    1,031
    William Brogden
    Aug 5, 2004
  3. Replies:
    1
    Views:
    3,218
    PeterKellner
    May 16, 2006
  4. Sam
    Replies:
    0
    Views:
    704
  5. Peter Afonin

    Posting data with Master pages

    Peter Afonin, Jan 8, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    337
    Peter Afonin
    Jan 8, 2007
Loading...

Share This Page