Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing default button and focus in ASP.Net Wizard

Status
Not open for further replies.

Strobeman

Programmer
May 16, 2003
40
AU
I am running the following code in my Page_PreRender and it is not changing the buttons or focus. Any ideas what I am doing wrong?

switch (CreateQuoteWizard.ActiveStep.Wizard.ActiveStepIndex)
{
case 0:
Master.Page.Form.DefaultFocus = FirstName.ClientID;
Master.Page.Form.DefaultButton = CreateQuoteWizard.ActiveStep.FindControl("StartNavigationTemplateContainerID").FindControl("StartNextButton").UniqueID;
break;
case 1:
Master.Page.Form.DefaultFocus = ValueOfWorksOrTurnover.ClientID;
Master.Page.Form.DefaultButton = CreateQuoteWizard.ActiveStep.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton").UniqueID;
break;
case 2:
Master.Page.Form.DefaultFocus = PrincipalsSupplies.ClientID;
Master.Page.Form.DefaultButton = CreateQuoteWizard.ActiveStep.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton").UniqueID;
break;
case 3:
Master.Page.Form.DefaultButton = CreateQuoteWizard.ActiveStep.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton").UniqueID;
break;
default:
break;
}

Thanks
 
Try using the Page Load event and using the Focus method of the relevant control.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks ca8msm but this does not work. The Page Load event does get the ActiveStepIndex confused and the focus is only working on the first screen for the textbox. The buttons do not even come up in the predictive text.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top