?
Solved

How to transfer all values from MultiView Form(TextBox, DropDown List, etc...) to another form

Posted on 2009-05-05
9
Medium Priority
?
399 Views
Last Modified: 2013-11-26
Hi,

I have a simple multiview form (Default.aspx) which gets information from user/s and what i wanted to do is to have a button in the last tab of the multiview form (Default.aspx) that will redirect to another form (PrintForm.aspx   -   The PrintForm is like the collection of all tabs of multiview form placed into one form) with all the values collected from the multiview form..
Is this possible? (I'm a noob) I'd appreciate if  anyone can show me how it should be done.

I've attached my code for both Default.aspx and PrintForm.aspx.
Code-File---Default.docx
Code-File---PrintForm.docx
Default.docx
PrintForm.docx
0
Comment
Question by:jsuanque
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 12

Expert Comment

by:GuitarRich
ID: 24302449
I would create an entity class to hold all the values entered in the form and then store that class in the session when the print button is pressed. In the print form you can then retrieve the values from the session and enter the data on to the form in the Page_Load event.
Or if the data is going to be stored in the database, just pass an ID in the query string to the print form and get the data from the database when the print form loads.
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24302828
I think it would not be a good idea to save everything to the session and transfer to different page. It will be a big overhead(obviously depending on what and how much data is being pushed to session). I think you should save everything to the database and then retrieve it in the print page. Otherwise, write it to a random file and pass the name of file to the print page.
0
 

Author Comment

by:jsuanque
ID: 24303063
Hello GuitaRich/ CodeCruiser,

Noted the overhead when pushig enough data in a session. But as per both your suggestion; my understanding is that there will be a save button in the Default page which strores all the data entered/selected by the user directly to database. Then will it be another redirected page or button which will give you option to print the form based on the content that was entered where the info will be fetched from the save data from the database? Seems very complicated for a noob:)) I mean theory wise it's easy but coding will be a nightmare for me since i don't have much experience...
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 12

Accepted Solution

by:
GuitarRich earned 500 total points
ID: 24303088
when the data is saved, you need to get the Id of the new record, this could be stored in a hidden field in the page and then used when the user clicks the button to print the page. To get it to the print page, just put it on the Url and use the Request.QueryString object to get the data back in the print form.
like this:
Response.Redirect("~/printform.aspx?id=" + idField.Text);
And in the print form:
string id = Request.QueryString["id"].ToString();
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24303153
If you are storing the data in the database anyway then it should not be a big problem. You just have to retrieve the data and display it on the printform page. You could also store the id in the session instead of passing it in querystring.
0
 

Author Comment

by:jsuanque
ID: 24304643
CodeCruise/GuitarRich,

My intent is to have less activity or interface from the user as much as possible. But your suggestion seems open ended from a noob's pont of view. I mean shall all the suggested activiy (i.e. save the data entered or selected from theform directly to database then show a form which has all those saved data in just one button? or shall it be multiple activities (e.g. button_click then redirect to new form then another button to populate it based on the id?)?

My apologies here....it's noob your speaking.
0
 

Author Comment

by:jsuanque
ID: 24304674
Code cruiser,

Your suggestion is very much intersting as well as GuitarRich. But i could probably get the picture more clearly if you could show some code :)
0
 
LVL 83

Assisted Solution

by:CodeCruiser
CodeCruiser earned 500 total points
ID: 24304692
You would have a Save button on first form. This button would save all the data to the database. Depending on your scenario, you could then directly navigate to print button or you could show a separate Print button to the user. Whichever way, on the page loading of the print page, you would use the ID to automatically populate everything from the database and may be even print it directly or put a button to print.
0
 

Author Closing Comment

by:jsuanque
ID: 31577918
Thanks guys!!!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question