473,770 Members | 1,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Default Buttons and Wizard Weirdness

JJ
I have two related problems:

(a). trying to set the default button within a CreateUserWizar d control
-----------------------------------------------------------------

I've done this in a messy way (see below) and wonder if anyone know how I
could have done it using nested FindControl's and ClientID/UniqueID (I tried
jst about every combination!)
The button names you see in the code were obtained by viewing the source of
the html pages. I was hoping I could use something like:

Master.Page.For m.DefaultButton =
Wizard1.ActiveS tep.FindControl ("CreateUserWiz ard1").FindCont rol("btn_Create User").UniqueID

- but I just couldn't get this or any combination of it to work. So my
current code to set the deafult button is:

protected void Page_Load(objec t sender, EventArgs e)
{
Control theButton;
int StepIndex = CreateUserWizar d1.ActiveStepIn dex;

if (StepIndex == 0)
{
theButton =
this.FindContro l("ctl00$MainCo ntent$CreateUse rWizard1$__Cust omNav0$btn_Crea teUserButton");
}
else
{
theButton =
this.FindContro l("ctl00$MainCo ntent$CreateUse rWizard1$Comple teStepContainer $ContinueButton ");
}
Master.Page.For m.DefaultButton = theButton.Uniqu eID;
}

(b) Detecting when we're at the 'Complete' step
------------------------------------------------

In the above code you'll notice I am checking for the StepIndex. However, I
notice this only changes when the 'Complete' button is clicked on the second
stage!
i.e. after clicking the 'Create User' button on step 1 (StepIndex '0') the
next page appears with my complete step template information and a
'complete' button at the bottom.
yet the StepIndex is still '0'. Only when I click on the 'Continue' button
does it change to '1'.

In which case am I checking the index at the wrong point? How do I detect
when the user is viewing the 'Complete' step?

JJ
Sep 22 '06 #1
1 3069
JJ
OK I solved part (b) by doing this(see below) but I am still needing help on
how to correctly set the default button (part (a))

protected void Page_Load(objec t sender, EventArgs e)
{
SetWizardDefaul tButton();
}

protected void OnActiveStepCha nged(object sender, EventArgs e)
{
SetWizardDefaul tButton();
}
protected void SetWizardDefaul tButton()
{
Control theButton;
int StepIndex = CreateUserWizar d1.ActiveStepIn dex;
if (StepIndex == 0)
{
theButton =
this.FindContro l("ctl00$MainCo ntent$CreateUse rWizard1$__Cust omNav0$btn_Crea teUserButton");
}
else
{
theButton =
this.FindContro l("ctl00$MainCo ntent$CreateUse rWizard1$Comple teStepContainer $ContinueButton ");
}

Master.Page.For m.DefaultButton = theButton.Uniqu eID;
}




"JJ" <ab*@xyz.comwro te in message
news:uo******** ******@TK2MSFTN GP02.phx.gbl...
>I have two related problems:

(a). trying to set the default button within a CreateUserWizar d control
-----------------------------------------------------------------

I've done this in a messy way (see below) and wonder if anyone know how I
could have done it using nested FindControl's and ClientID/UniqueID (I
tried jst about every combination!)
The button names you see in the code were obtained by viewing the source
of the html pages. I was hoping I could use something like:

Master.Page.For m.DefaultButton =
Wizard1.ActiveS tep.FindControl ("CreateUserWiz ard1").FindCont rol("btn_Create User").UniqueID

- but I just couldn't get this or any combination of it to work. So my
current code to set the deafult button is:

protected void Page_Load(objec t sender, EventArgs e)
{
Control theButton;
int StepIndex = CreateUserWizar d1.ActiveStepIn dex;

if (StepIndex == 0)
{
theButton =
this.FindContro l("ctl00$MainCo ntent$CreateUse rWizard1$__Cust omNav0$btn_Crea teUserButton");
}
else
{
theButton =
this.FindContro l("ctl00$MainCo ntent$CreateUse rWizard1$Comple teStepContainer $ContinueButton ");
}
Master.Page.For m.DefaultButton = theButton.Uniqu eID;
}

(b) Detecting when we're at the 'Complete' step
------------------------------------------------

In the above code you'll notice I am checking for the StepIndex. However,
I notice this only changes when the 'Complete' button is clicked on the
second stage!
i.e. after clicking the 'Create User' button on step 1 (StepIndex '0') the
next page appears with my complete step template information and a
'complete' button at the bottom.
yet the StepIndex is still '0'. Only when I click on the 'Continue' button
does it change to '1'.

In which case am I checking the index at the wrong point? How do I detect
when the user is viewing the 'Complete' step?

JJ

Sep 22 '06 #2

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

Similar topics

3
3281
by: YT | last post by:
Greetings, Just wondering if someone out there can help with this issue. I have a questionnaire that i'm building. Each step is a separate web page with a form and a next button & back button, similar to a wizard. What i would like to do is to make sure that all the information on the form gets retained. i'm doing this via asp & session cookies. So when the user clicks the next button, the form info is submitted and put into session...
9
6750
by: Karl Roes | last post by:
Hi All, I would like some advice on Next / Previous record buttons. I have a main form for the client, and a continuous subform listing client transactions. If I open one of these transactions ( dblclick ) in say 'frmtransaction', I would like to scroll forward and backward through the transactions as they appear on the continuous subform without actually having to close 'frmtransaction' and go back to the subform.
1
1221
by: Sarah Smith via AccessMonster.com | last post by:
I am using the Command Button Wizard to create a 'Find Record' button on my form. The Wizard sets the defaults to be 'Find Next' for the buttons and 'Whole', 'Entire' and 'Current Record' for the criteria. How can I change these so that everytime I open the form, I don't have to manually reset them? Thanks -- Message posted via http://www.accessmonster.com
11
4817
by: MLH | last post by:
Why is that? If I choose the tiny check boxes which are hard to hit with a mouse, it works fine. But option buttions, shich can be sized big enough for people with limited sight and dexterity to hit - they don't work at all. Its true. I created 'em with the built-in wizard furnished with Access 97 but they do not work. I put 12 of 'em in the group, labeled the months of the year and giving
2
1843
by: Jon Booth | last post by:
I am using ascx controls to build headers and footers for my wbe application. 3 questions 1) How do I set it so that when I create a new web form created inherits from my SecurePage class and not System.Web.UI.Page by default. 2) The HTML created by default by Visual Studio does not contain <HTML><HEAD><BODY> etc as my ascx files already contain this. Ho can I modify the HTML it provides by default?
1
2174
by: JJ | last post by:
What trouble I'm having setting default buttons on a page (with a master page). I got around doing it on a page basis by calling the SetWizardDefaultButton() routine from page load. Notice how messy it looks because I could not find the required button any other way but by using the id it is given in the source code. I tried every combination of nested 'findcontrol' methods I could think of, but none worked??!! It seems to be...
0
1377
by: Glenn | last post by:
I currently have a page that contains a logon control and a Wizard control. I am having an issue when the user hits the "Enter" key, the user gets logged off. This is because the logon control appears at the top of the page and the browser defines the first submit button that appears on the page as the "default" button. On other pages I have resolved this issue by wrapping my input controls in an ASP Panel and setting the panel's...
3
2049
by: Andy B | last post by:
I want to make an xslt file that formats and displays data from an XElement object through an xml control. I need to have the xslt file show edit/remove buttons next to each element/attribute that is displayed on the page. These buttons/links do have to actually work in the sense that you can actually edit/remove the particular element/attribute. Is there any way to do something like this?
2
6950
by: 6afraidbecause789 | last post by:
Hi - Has anyone ever used toggle buttons to select items in a listbox? I'd like to put about 24 toggle buttons on an unbound form that select or deselect items in a multiple select listbox. I've come across a way to set the listbox value to only 1 at a time, but need multiple toggle buttons to be on their corresponding listbox item values to be selected. Thanks!
0
9595
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10059
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...
1
10008
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9873
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
8891
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...
1
7420
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5454
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3974
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
3578
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.