473,750 Members | 2,668 Online
Bytes | Software Development & Data Engineering Community
+ 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
OnActiveStepEve nt that fires on every step and the code looks like
this:

if (Wizard.ActiveS tepIndex == 2)
{
switch (RadioButtonLis t.SelectedValue )
{
case "2":
Wizard.ActiveSt epIndex = 2;
break;
case "3":
Wizard.ActiveSt epIndex = 3;
break;
}
}

I also have the following code

if (Wizard.ActiveS tepIndex == 3)
{
Preforming some logic here
Wizard.ActiveSt epIndex = 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 2310
Hi,

Try this:
[OnActiveStepEve nt EventHandler]
{
switch (Wizard.ActiveS tepIndex)
{
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 (RadioButtonLis t.SelectedValue )
{
case "2":
/*
<Logic for Step 3 goes here...>
*/
break;
case "3":
Wizard.ActiveSt epIndex = 3;
break;
}
break;
case 3://Step 4
/*
<Logic for Step 4 goes here...>
*/
Wizard.ActiveSt epIndex = 4;
break;
case 4://Step 5
/*
<Logic for Step 5 goes here...>
*/
break;
}
}

Hope this helps!
Thanks -

"Nightcrawl er" <th************ @gmail.comwrote in message
news:11******** **************@ k79g2000hse.goo glegroups.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
OnActiveStepEve nt that fires on every step and the code looks like
this:

if (Wizard.ActiveS tepIndex == 2)
{
switch (RadioButtonLis t.SelectedValue )
{
case "2":
Wizard.ActiveSt epIndex = 2;
break;
case "3":
Wizard.ActiveSt epIndex = 3;
break;
}
}

I also have the following code

if (Wizard.ActiveS tepIndex == 3)
{
Preforming some logic here
Wizard.ActiveSt epIndex = 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
3715
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 - and dump everything into a table. The problem is once I have the data imported into a new table, I can't do much with it. If I try to run an Append query and insert data from the new table into an existing table, the query fails - "Error...
2
4358
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 not be saved."
2
4267
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 for the repost. I'd like to make use of the asp:Wizard control to present a step-by-step guided experience for my user to fill out a complicated data-entry form. I'd like to make use of two-way databinding provided by the asp:FormView control...
6
2086
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 the data from the fields to which they are bound; yet they will return null values when the 'Update' LinkButton is clicked. The responder thought this might have something to do with naming containers. If so, this is similar to an issue in...
3
4071
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 'ObjectDataSource1' has no values to insert. Check that the 'values' dictionary contains values." I have found I can suppress the error by placing a hidden field inside
4
6854
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 user control that is it now the current "page" so I can restrict some of the initialization to occur only when the step is visible? I have a couple of controls that hit the database and don't want the overhead if the use isn't even looking at that...
12
2597
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 application, these button work automatically, means we can go to next step, previous step by clicking on corresponding buttons. In my application I have 3 steps. On Next button click of step 1, I want two things to happen. One is inserting data of step 1 in...
2
7001
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, Footer, Side bar and Body One of the content panels would use a Wizard control stepping the user through submitting an Ergonomic Review Request.
8
10837
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 steps successfully with the following code... Control myContainer = (Control)Wizard1.FindControl("SideBarContainer"); DataList mySideBarList = (DataList)myContainer.FindControl("SideBarList");
0
8838
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9583
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9396
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8263
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4888
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3323
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.