Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice on form submission

Status
Not open for further replies.

xloop

Programmer
Nov 12, 2001
86
GB
Hi

Scenario: Inputing new addresses

Using classic ASP i would typically write one page that gathered the address information then i would submit that information to another form which then inserts the information into the DB.

Ok thats fine, no problem.

When it comes to using ASP.NET, it makes sense to use just one page, you can easily gather the information and submit the form to itself then insert into DB, however, what i really want to do is be able to display a confirmation page before it gets submitted, i could fumble around with a panel object and show/hide it when necessary but it quickly becomes messy.

I'm having a problem submitting the form to another .aspx

if i edit the form tag to include action="ConfirmPage.aspx"

it just doesn't submit to that page, keeps submitting to itself, why??

Does anyone else have any views on the best way to handle this kind of scenario?

Many Thanks
Rob
 
Well, that's the tradeoff in ASP.NET. You don't have to use confirmation pages, and have all the information post to the same physical file, but it can get tricky whenyou want to display such a message to the user.

You can get away with this, as you said, by putting Panel server controls on a WebForm and then programmatically manipulating each's Visible property to display/hide the content and form elements contained within it.

You could feign a confirmation "page" in the same manner, but by posting the form input element data to ViewState and then calling it back from ViewState when the user confirms it's all good and then wants to post it to a DB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top