Last post Jun 16, 2010 09:08 PM by bcahill
Jun 07, 2010 10:56 PM|bcahill|LINK
I have a Wizard Control and want to store the data temporarily. The data will have categories and sub categories. I'm thinking of doing the following:
1. Create XML when Wizard begins
2. Update XML with Wizard answers
3. Output XML to Wizard confirmation page
4. Update SQL DB with XML data after confirmation
5. Delete XML file
Does this make sense? Is there a better way or a best practice approach to handling this type of scenario? Thanks.
Jun 08, 2010 12:15 AM|Mikesdotnetting|LINK
The Wizard takes care of managing temporary data for you. Best practice in this case is to let it do it.
Jun 08, 2010 12:30 AM|yashwanthb|LINK
Best way i can say use temporary datatable to store the data
If you are using data with in same page use Viewstate to store datatable.
If you want in other pages use sessions .
It will take lot of effort to store in XML every time . and also round trips also increased ..
Jun 08, 2010 01:22 PM|bcahill|LINK
How does the Wizard save this data? I've been using ViewState. Is there a better way?
Jun 08, 2010 01:49 PM|Mikesdotnetting|LINK
How does the Wizard save this data? I've been using ViewState.
Ermmm... it uses ViewState.
Jun 08, 2010 01:52 PM|Mikesdotnetting|LINK
Oh - hold on a minute. Are you talking about temporarily storing databound stuff, likethat which appears in dropdowns within steps? Or are you talking about the data that the user provides while going through a Wizard?
Jun 08, 2010 02:09 PM|bcahill|LINK
The latter. Saving the data the user enters. This data is going to be in a hierarchical format and could have an infinite number of ParentItems and infinite number of Subitems beneath each ParentItem. See below for an example. The ParentItem is defined
on step 1 and step 2 allows the user to enter subitems using dynamically generated textboxes. Once they are finished, the results would be displayed back to them and finally they would submit. At this point the temporary data would be committed to the database
and associated with their UserId. I thought XML would be a good way to do this for temporarily storing. The temporary data table sounds like a possibility as well though. Not sure how people typically handle a situation like this.
ParentItem1 (dynamically named by user) - Step 1
SubItem1 - x (dynamically named by user) - Step 2
Asks user if they would like to enter another ParentItem, if yes then repeat.
ParentItem2 (dynamically named by user)
SubItem1 - x (dynamically named by user)
Jun 08, 2010 03:17 PM|Mikesdotnetting|LINK
The latter. Saving the data the user enters
That's what is currently managed by ViewState automatically - assuming that your dynamically generated controls are set up to take part in ViewState:
Jun 08, 2010 03:34 PM|bcahill|LINK
I think I need to get a better understanding of ViewState. Thanks.
Jun 16, 2010 09:08 PM|bcahill|LINK
This is what I was looking for in case anyone else runs into a similar issue: http://msdn.microsoft.com/en-us/library/aa478959.aspx