Solved

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

Posted on 2009-05-05
9
384 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
 
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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:…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now