473,466 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Wizard Control Challenge

I am using a Wizard control with 5 steps. On step 2 the user is
present with a radiobuttonlist with two listitems in it. If the first
radiobutton is selected I want to take the user to step 3, if the
second is selected I want to take the user to step 4. I have the
OnActiveStepEvent that fires on every step and the code looks like
this:

if (Wizard.ActiveStepIndex == 2)
{
switch (RadioButtonList.SelectedValue)
{
case "2":
Wizard.ActiveStepIndex = 2;
break;
case "3":
Wizard.ActiveStepIndex = 3;
break;
}
}

I also have the following code

if (Wizard.ActiveStepIndex == 3)
{
Preforming some logic here
Wizard.ActiveStepIndex = 4;
}

Here is the problem. If case = 2 the first if statement takes the user
is taken to ActiveStepIndex = 2 (Step 3) just like it is supposed to.
When the user then clicks 'next' the second if statement becomes true,
some logic is preformed and the user gets taken to ActiveStep = 4
(step 5).

However, if case = 3 the first if statement takes the user to
ActiveStepIndex = 3 (step 4) BUT that steps get skipped since the
second if statement now becomes true and the user gets taken to
ActiveStep = 4 (step 5) right away instead. In addition I get an error
since the the logic performed in the second if statement is only
supposed to be executed if case = 2.

Is there a way to solve this problem in some nice, clean way?

Thanks

Jun 22 '07 #1
1 2292
Hi,

Try this:
[OnActiveStepEvent EventHandler]
{
switch (Wizard.ActiveStepIndex)
{
case 0://Step 1
/*
<Logic for Step 1 goes here...>
*/
break;
case 1://Step 2
/*
<Logic for Step 2 goes here...>
*/
break;
case 2://Step 3
switch (RadioButtonList.SelectedValue)
{
case "2":
/*
<Logic for Step 3 goes here...>
*/
break;
case "3":
Wizard.ActiveStepIndex = 3;
break;
}
break;
case 3://Step 4
/*
<Logic for Step 4 goes here...>
*/
Wizard.ActiveStepIndex = 4;
break;
case 4://Step 5
/*
<Logic for Step 5 goes here...>
*/
break;
}
}

Hope this helps!
Thanks -

"Nightcrawler" <th************@gmail.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
>I am using a Wizard control with 5 steps. On step 2 the user is
present with a radiobuttonlist with two listitems in it. If the first
radiobutton is selected I want to take the user to step 3, if the
second is selected I want to take the user to step 4. I have the
OnActiveStepEvent that fires on every step and the code looks like
this:

if (Wizard.ActiveStepIndex == 2)
{
switch (RadioButtonList.SelectedValue)
{
case "2":
Wizard.ActiveStepIndex = 2;
break;
case "3":
Wizard.ActiveStepIndex = 3;
break;
}
}

I also have the following code

if (Wizard.ActiveStepIndex == 3)
{
Preforming some logic here
Wizard.ActiveStepIndex = 4;
}

Here is the problem. If case = 2 the first if statement takes the user
is taken to ActiveStepIndex = 2 (Step 3) just like it is supposed to.
When the user then clicks 'next' the second if statement becomes true,
some logic is preformed and the user gets taken to ActiveStep = 4
(step 5).

However, if case = 3 the first if statement takes the user to
ActiveStepIndex = 3 (step 4) BUT that steps get skipped since the
second if statement now becomes true and the user gets taken to
ActiveStep = 4 (step 5) right away instead. In addition I get an error
since the the logic performed in the second if statement is only
supposed to be executed if case = 2.

Is there a way to solve this problem in some nice, clean way?

Thanks

Jun 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: deko | last post by:
I've been trying to use the Access Import Wizard to expedite importing data into my mdb. The nice thing about the wizard is that I can import from different file formats - txt, xls, even Outlook -...
2
by: Nick | last post by:
Is there anyway to get a javascript confirm button on the wizard control so that when a user clicks "cancel" it can prompt something like... "Are you sure you want to cancel? Your changes will...
2
by: John R. Lewis | last post by:
I posted this yesterday with a different email address. I am reposting with my fake-address as given to me by Microsoft so that I can be guraranteed a response from a support representative. Sorry...
6
by: Douglas J. Badin | last post by:
Earlier this month, there was a posting about this without a definitive answer. If you place a Wizard inside a FormView's EditItemTemplate the bound fields contained within the View will display...
3
by: chrisn | last post by:
Hi, (Using ASP.Net 2.0) I have a wizard control inside a detailsview control. When I attempt to call the InsertItem method on the DetailsView I get an error "ObjectDataSource...
4
by: Dabbler | last post by:
I have a Wizard control with each step using a user control. It seems the page_load of each user control is called everytime a postback event occurs in any step. Is there away to communicate to a...
12
by: raghav | last post by:
Hi I am working on ASP.NET 2.0. I am developing a website using Wizard control. Based on number of steps added, next, previous, finish buttons generate automatically. After running the...
2
by: BJ | last post by:
I had this crazy idea. We have an existing application that could use some rework. I was going to redo the application (currently ASP.Net 1.1) using ASP.Net 2.0: Master page with Header,...
8
by: GaryDean | last post by:
I have a Wizard page and need to affect the next and previous buttons from my code-behind. I've googled around and found two solutions, and neither appear to work. I can access the SideBarList...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.