When pressing enter after entering something in a textbox within the wizard - it switches to pevious wizard step. Seems that the "previous" button is the default. I want the "next" button to be the default. How can I do that
if (Wizard1.ActiveStep.ID == "FirstStep")
Master.Page.Form.DefaultButton = "StartNextButton";
else
if (Wizard1.ActiveStep.ID == "LastStep")
Master.Page.Form.DefaultButton = "FinishButton";
else
Master.Page.Form.DefaultButton = "StepNextButton";
(The button id's have been reduced... replace buttonid with the actual UniqueID by looking into source)
Marked as answer by pulsmartin on Feb 28, 2012 05:58 AM
Here the exact code to find that button for anyone else who had this problem
Dim btn As Button = Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton")
Master.Page.Form.DefaultButton = btn.UniqueID
Marked as answer by pulsmartin on Feb 28, 2012 05:58 AM
pulsmartin
Member
108 Points
309 Posts
wizard next button should be default
Feb 23, 2012 06:28 AM|LINK
When pressing enter after entering something in a textbox within the wizard - it switches to pevious wizard step. Seems that the "previous" button is the default. I want the "next" button to be the default. How can I do that
avinash_bhud...
Contributor
2881 Points
517 Posts
Re: wizard next button should be default
Feb 23, 2012 06:45 AM|LINK
Try something like this.
if (Wizard1.ActiveStep.ID == "FirstStep") Master.Page.Form.DefaultButton = "StartNextButton"; else if (Wizard1.ActiveStep.ID == "LastStep") Master.Page.Form.DefaultButton = "FinishButton"; else Master.Page.Form.DefaultButton = "StepNextButton"; (The button id's have been reduced... replace buttonid with the actual UniqueID by looking into source)pulsmartin
Member
108 Points
309 Posts
Re: wizard next button should be default
Feb 28, 2012 05:58 AM|LINK
Here the exact code to find that button for anyone else who had this problem
Dim btn As Button = Wizard1.FindControl("FinishNavigationTemplateContainerID").FindControl("FinishButton")
Master.Page.Form.DefaultButton = btn.UniqueID