Best practices for temporary data RRS feed

  • Question

  • User-404273546 posted

    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.

    Monday, June 7, 2010 10:56 PM


All replies

  • User-821857111 posted

    The Wizard takes care of managing temporary data for you. Best practice in this case is to let it do it.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 8, 2010 12:15 AM
  • User165950705 posted

    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 ..

    Tuesday, June 8, 2010 12:30 AM
  • User-404273546 posted

    How does the Wizard save this data?  I've been using ViewState.  Is there a better way?

    Tuesday, June 8, 2010 1:22 PM
  • User-821857111 posted

    How does the Wizard save this data?  I've been using ViewState.

    Ermmm... it uses ViewState.

    Tuesday, June 8, 2010 1:49 PM
  • User-821857111 posted

    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?

    Tuesday, June 8, 2010 1:52 PM
  • User-404273546 posted

    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)

    Tuesday, June 8, 2010 2:09 PM
  • User-821857111 posted

    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: http://www.singingeels.com/Articles/Dynamically_Created_Controls_in_ASPNET.aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, June 8, 2010 3:17 PM
  • User-404273546 posted

    I think I need to get a better understanding of ViewState.  Thanks.

    Tuesday, June 8, 2010 3:34 PM
  • User-404273546 posted

    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

    Wednesday, June 16, 2010 9:08 PM