Solved

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

Posted on 2009-05-05
9
392 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
  • 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
LVL 12

Accepted Solution

by:
GuitarRich earned 125 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 125 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

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!

Question has a verified solution.

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

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 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