I have a wizard control with id 'Wizard1'. I define the following startnavigationtemplate for the next button on start section of wizard. How would I access the next button programatically?
Jessica Cao
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”
sun21170
Contributor
3421 Points
1189 Posts
Trying to access next button in StartNavigation template of a Wizard control?
Jun 07, 2007 02:01 AM|LINK
I have a wizard control with id 'Wizard1'. I define the following startnavigationtemplate for the next button on start section of wizard. How would I access the next button programatically?
<StartNavigationTemplate>
<asp:Button ID="btnXNext" runat="server" CommandName="MoveNext" CausesValidation="true"
Text="Next >>" BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" ></asp:Button>
</StartNavigationTemplate>
Jessica Cao ...
All-Star
25328 Points
2567 Posts
Re: Trying to access next button in StartNavigation template of a Wizard control?
Jun 08, 2007 08:03 AM|LINK
Hello sun,
Please try the following code
public partial class WizardButton : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Button nextB = Wizard1.FindControl("StartNavigationTemplateContainerID$btnXNext") as Button;
nextB.Attributes.Add("onclick","javascript:alert('ok');");
}
}
<asp:Wizard ID="Wizard1" runat="server">
<StartNavigationTemplate>
<asp:Button ID="btnXNext" runat="server" CommandName="MoveNext" CausesValidation="true"
Text="Next >>" BackColor="White" BorderColor="#507CD1" BorderStyle="Solid" BorderWidth="1px"
Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284E98" ></asp:Button>
</StartNavigationTemplate>
<WizardSteps>
<asp:WizardStep runat="server" Title="Step 1">
</asp:WizardStep>
<asp:WizardStep runat="server" Title="Step 2">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
Hope it helps,
Jessica
Sincerely,
Microsoft Online Community Support
“Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”