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
Solved

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

Posted on 2009-05-05
9
390 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
hbo knew my windows software 4 60
Upgrading my SSIS package in VS 2012 6 59
SSIS On fail action 5 37
vb.net convert long time to mm:ss 8 6
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

809 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