Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / January 2006

Tip: Looking for answers? Try searching our database.

How to create preview page before submitting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Syam - 16 Jan 2006 16:36 GMT
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.
Spam Catcher - 16 Jan 2006 17:01 GMT
> 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.

Signature

Stan Kee (spamhoneypot@rogers.com)

Daniel - 16 Jan 2006 18:36 GMT
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.

> Hello everyone,
>
[quoted text clipped - 17 lines]
> before
> actually updating the database? Thanks in advance.
Kurt Farrar - 16 Jan 2006 23:12 GMT
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.

Signature

Kurt Farrar
.NET Developer & Computer Enthusiast

> Hello everyone,
>
[quoted text clipped - 12 lines]
> How do I go about doing this, where should I store the temporary data before
> actually updating the database? Thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.