This is a migrated thread and some comments may be shown as answers.

Restarting/Looping a Wizard Control

5 Answers 75 Views
Miscellaneous
This is a migrated thread and some comments may be shown as answers.
Vikas Sharma
Top achievements
Rank 1
Vikas Sharma asked on 04 Dec 2006, 09:05 AM
Hi!

I wanted to know if you guys have come across a situation where you had to restart (Loop through) a Wizard control multiple times. I have a Wizard control that I would like to restart, once the user clicks on the finish button. the number of times the Wizard control is restarted, can be based on a value retreived from a session variable or a input textbox.

Any ideas would be highly appreciated.

Regards

Vik

5 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Dec 2006, 10:43 AM
Hello Vikas,

You can reset the Wizard control to the initial page by setting the ActiveStepIndex property of the wizard to 0.

MSDN Example and sample code:
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.wizard.activestepindex.aspx

All the best,
Rumen Stankov (MCSD.NET)
the telerik team
0
Vikas Sharma
Top achievements
Rank 1
answered on 04 Dec 2006, 07:24 PM
Thanks for the prompt reply Rumen.

I was aware of the ActiveStepIndex property and did try using it. How can I get the Wizard to loop a certain number of times though?

Regards

Vik
0
Rumen
Telerik team
answered on 05 Dec 2006, 07:22 AM
Hi Vikas,

This really depends on your scenario. I can suggest using a counter stored in the Session - this way the counter will get incremented each time (and will not be reset after postback).

...
int counter = (int) Session["wizardCounter"];
counter++;
Session["wizzardCounter"] = counter;
...

All the best,
Rumen Stankov (MCSD.NET)
the telerik team
0
Vikas Sharma
Top achievements
Rank 1
answered on 05 Dec 2006, 07:28 AM
Thanks for the prompt reply once again Rumen.

I can store it as session variable and then perhaps loop through it. What would the code look like in VB.NET? Lets say if the session had a value of 3, how can I get the Wizard to loop 3 times only?

Much appreciate your help.

Regards

Vik 
0
Rumen
Telerik team
answered on 05 Dec 2006, 09:17 AM
Hello Vikas,

...
Dim counter As Integer = CType(Session("wizardCounter"), Integer)
counter = counter + 1
If Counter < 3
    ' loop
Else
    ' do not loop
EndIF

Session("wizardCounter") = counter
...


Best wishes,
Rumen Stankov (MCSD.NET)
the telerik team
Tags
Miscellaneous
Asked by
Vikas Sharma
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Vikas Sharma
Top achievements
Rank 1
Share this question
or