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