Hej
Håller på och pysslar med CreateUserWizard kontrollen för första gången...
Har använt kod jag hade tidigare i <tabel> och där fungerade den felfritt..
Har lite olika kontroller i det steg jag går bet på..där finns det en DropDownList som jag väljer land i och till den har jag skapat en SelectedIndexChanged metod som skall visa en DropDownList kontroll till när jag väljer USA sm land annars skall den vara dold......
Nu fungerar det inte...
Här har Ni min metod:
protected void companyCountryDropDownList_SelectedIndexChanged(object sender, EventArgs e)
{
Label lblUsState = registrationWizard.FindControl("lblUsState") as Label;
Control ctl = null;
ctl = registrationWizard.CreateUserStep.ContentTemplateContainer.FindControl("companyCountryDropDownList");
DropDownList countryDropDownList = null;
Control ctl2 = null;
ctl2 = registrationWizard.CreateUserStep.ContentTemplateContainer.FindControl("usStateDropDownList");
DropDownList usStateDropDownList = null;
if (countryDropDownList != null)
{
if (countryDropDownList.SelectedItem.Text != "United States of America")
{
TextBox vatNumber = registrationWizard.FindControl("companyVatTextBox") as TextBox;
if (vatNumber != null)
Page.SetFocus(vatNumber);
usStateDropDownList.Visible = false;
usStateDropDownList.Enabled = false;
lblUsState.Visible = false;
lblUsState.Enabled = false;
}
else
{
if (usStateDropDownList != null)
Page.SetFocus(usStateDropDownList);
usStateDropDownList.Visible = true;
usStateDropDownList.Enabled = true;
lblUsState.Visible = true;
lblUsState.Enabled = true;
}
}
}
....någon som har en lösning........... håller på och bli gråhårig :-(