How to create preview page before submitting

G

Guest

Hello everyone,

I am just barely two months old into learning asp.net and vb.net. Currently
I am working on a project to store customer database. I have a question about
creating a preview page:

I have a main page that uses forms to input customer information such as
name, contacts etc... Once all information is filled up, I would like to
preview it irst before submitting to the database. On the main page, there
should be a preview button which will pop-up another page that display all
the information that I have entered. This new pop-up preview page should have
a "Submit" and "Cancel" button. "Submit" button will then update the database
with the information entered from the main page.

How do I go about doing this, where should I store the temporary data before
actually updating the database? Thanks in advance.
 
G

Guest

How do I go about doing this, where should I store the temporary data
before actually updating the database? Thanks in advance.

Create a second preview page with all the necessary labels.

There are a bunch of places where you can temporary information:

Session Variables, Query String, ViewState, Context Items, Database,
Cookies.

In your situation you may want to consider building a simple object (or
structure) to store all of your data. Then save the object to a session
variable - redirect to the second page, extract the info out of the object
and display. When the user presses submit, extract the data from the
object, and save to DB.
 
D

Daniel

Sounds like you want to make a confirmation page.

i would have all my vars stored in page A then on click submit or whatever
button you have post that data to page B 9confirmation preview page).

Catch all the posted vars and set a load of text boxes on that preview page
to those caught vars but on this page have the text boxes read only.

At the bottom of the page have a 'is this right? ' or whatever and a final
submit button as you suggested. On clicking that submit button inside there
have your code to write the info to the db or whatever by using the values
of the text boxes.

Hope that makes sense.
 
G

Guest

I agree with the first two replies. You can either pass your variables
through the variables mentioned by 'Spam Catcher' (my preference for this
being the Session variable) or you could pass the variables through a get /
post using the query string or form fields.

Another alternative that you may want to consider is that you don't actually
move pages when your user clicks submit.

Alongside where your form controls are, you could place labels that are
hidden initially. When the user clicks the submit button the label's .text
properties are set to the .text properties of their corresponding form
fields. The form fields could then be hidden and the labels unhidden.

Would allow you keep all this in one page instead of trying to come up with
consistent naming for your confirmation pages if there becomes more than one
(as is usually the case).

Just an idea.

Hope this helps.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,127
Latest member
CyberDefense
Top