Multiple forms on ASP.NET page

后端 未结 4 566
感情败类
感情败类 2020-12-03 16:21

Coming from a Classic ASP background, I\'m used to multiple forms on a page, but this clearly limited in a ASP.NET page.

However, I have a situation where I have a f

相关标签:
4条回答
  • 2020-12-03 16:45

    A workaround for this paypal is to use the Paypal Integration Code as Paypal is not always the most friendly to integrate. The hard work is basically done for you.

    0 讨论(0)
  • 2020-12-03 16:47

    A basic approach is to use two panels on the page - one for the first form and another for the second.

    You can change the visibility property of these panels depending on which form you want to display (during page_load or any time before rendering).

    0 讨论(0)
  • 2020-12-03 16:50

    You can have multiple forms, it's just only one form may have the runat="server" attribute.

    There are a bunch of answers to getting PayPal to work; but as it's a learning vehicle that may be cheating. In all honesty, I'd look at the full-blown PayPal API rather than use the method of the somewhat simplistic form (with the added advantage that it should stretch your learning more).

    Otherwise yes, set up an HTML form outside of the server side form, and add a literal into it and write the bits and pieces in there.

    0 讨论(0)
  • 2020-12-03 16:57

    Maybe I'm misunderstanding the question, but can't you simply have 2 divs inside the form, where only one is visible at any time. e.g.

    <form id="Form1" method="post" runat="server">
        <div id="getUserInput" visible="true">
              <asp:button id="btnSubmitFirst" />
        </div>
        <div id="doSubmissionToPaypal" visible="false">
              <asp:button id="btnSubmitSecond" />
        </div>
    </form>
    

    Then, in btnSubmitFirst_Click:

     doSubmissionToPaypal.visible=True
     getUserInput.visible = false
    

    Something along those lines?

    0 讨论(0)
提交回复
热议问题