Is there a way that i can save data on each step in wizard control. I want to save data when user clicks next button on each step. I would like to save them to database , so that i can retrieve them back if user has opted to close and complete steps later without clicking finish button
Asked
Active
Viewed 3,656 times
3 Answers
2
In your code-behind, you can capture the "Active Step Changed" event and do whatever you want:
Protected Sub AddEmployeeWizard_ActiveStepChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles AddEmployeeWizard.ActiveStepChanged
'save your data here
End Sub
If you just want to save on a click of the Next button, you could instead do
Protected Sub myWizard_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles myWizard.NextButtonClick
'save your data here
End Su
b

Jacob Mattison
- 50,258
- 9
- 107
- 126
-
i would like 2 save data when clicked next button, this event will fire for both next, previous. Is there a way i can distinguish each ? – rs. Mar 05 '10 at 16:37
-
1Edited to add an example of saving on a Next click. – Jacob Mattison Mar 05 '10 at 16:51
-
yes that is correct answer, i tested it and it works perfectly, thank you – rs. Mar 05 '10 at 16:55
1
You can save data to Session or ViewState objects.
Also you can add you saving logic in wizard events: ActiveStepChanged, CancelButtonClick, FinishButtonClick, NextButtonClick, PreviousButtonClick, SideBarButtonClick.

sashaeve
- 9,387
- 10
- 48
- 61
0
In ASP.NET you can probably stick it in the Session variable.
In an WPF or Winforms app, you could just put it in a variable in memory, and if these are settings for your program, you could save them to an XML file.

Tony The Lion
- 61,704
- 67
- 242
- 415
-
i would like to save each step, bcos user may close browser and complete them later – rs. Mar 05 '10 at 16:32