I inherited an application that used forms to POST data. I am not very familiar with Form behavior. To me, this is an arcane method of doing a POST. Plus, these forms break hardcore when converted to MasterPages because of Forms Nesting.
So I am refactoring, trying to minimize the dmg I'm doing. Are these two functionally equivalent?
Original method
<form id="transferForm" action="TransferSave.aspx" method="post">
<input type="button" id="Button2" class="button" onclick="transferForm.submit();" value="Review Transfer"/>
New way
<asp:Button ID="submitBtn" runat="server" class="button" Text="Review TransferX" PostBackUrl="TransferSave.aspx" />
I tested the new method and it worked. I just want to be sure that what I am doing doesn't create some nutty problem that I am unaware of. Mainly because I just don't feel like a master of html forms.
Is some different... At First PostBackURL does post to the same page and then redirects sending the form values, but not only the values you desired, ALL CONTROLS are sended...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With