C
CJM
I have a page that currently (and foolishly) has two forms... I'm coming
from an ASP Classic background, so I'd completely forgotten about the one
form limitation.
So I need to redesign it in some way... but how? I can imagine a number of
approaches and I've read about some approaches, but I haven't come across
clearly-the-best option.
Specifically, I have a form that gathers user information, and upon
postback, stores that information in a DB. When the form is posted back,
another form is also made visible - this form posts to Paypal and so doesn't
necessarily have to be a server-side form. However, I'm wanting to
dynamically alter certain form fields depending on the user input, so in
order to manipulate these fields (in Form_Load, upon Postback) I need to
set runat="server".
I'm still testing and debugging, but I would assume the server is going to
complain about this second form? Can I manipulate certain fields without
setting the whole form to runat="server"?
If this is going to be a problem, what is the best solution?
I can quickly think of 3 alternatives:
- either merge the forms together and alter the target upon Postback, or
dynamically replace one with the other,
- dynamically write the content of the Paypal form upon postback [actually,
is this possible??]
- redirect to a different page after the details have been written to the
DB.
Rewriting the form(s) sounds messy, but redirecting to a different page
sounds long-winded and inefficient. So I'm hoping that one of you guys can
wave your magic wand and present me the simple, neat and all-too-obvious
killer solution that I've been missing...
Any thoughts?
Thanks in advance.
Chris
PS. Yes, this is my first industrial strength ASP.NET app... in case you
couldn't tell!
from an ASP Classic background, so I'd completely forgotten about the one
form limitation.
So I need to redesign it in some way... but how? I can imagine a number of
approaches and I've read about some approaches, but I haven't come across
clearly-the-best option.
Specifically, I have a form that gathers user information, and upon
postback, stores that information in a DB. When the form is posted back,
another form is also made visible - this form posts to Paypal and so doesn't
necessarily have to be a server-side form. However, I'm wanting to
dynamically alter certain form fields depending on the user input, so in
order to manipulate these fields (in Form_Load, upon Postback) I need to
set runat="server".
I'm still testing and debugging, but I would assume the server is going to
complain about this second form? Can I manipulate certain fields without
setting the whole form to runat="server"?
If this is going to be a problem, what is the best solution?
I can quickly think of 3 alternatives:
- either merge the forms together and alter the target upon Postback, or
dynamically replace one with the other,
- dynamically write the content of the Paypal form upon postback [actually,
is this possible??]
- redirect to a different page after the details have been written to the
DB.
Rewriting the form(s) sounds messy, but redirecting to a different page
sounds long-winded and inefficient. So I'm hoping that one of you guys can
wave your magic wand and present me the simple, neat and all-too-obvious
killer solution that I've been missing...
Any thoughts?
Thanks in advance.
Chris
PS. Yes, this is my first industrial strength ASP.NET app... in case you
couldn't tell!