Asp.net StepNavigationTemplate在CreateUserWizard内不工作?
我正在尝试设置StepNavigationTemplate,但它不起作用Asp.net StepNavigationTemplate在CreateUserWizard内不工作?,asp.net,templates,createuserwizard,Asp.net,Templates,Createuserwizard,我正在尝试设置StepNavigationTemplate,但它不起作用 <asp:CreateUserWizard ID="CreateUserWizard1" runat="server"> <StepNavigationTemplate> <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePreviou
<asp:CreateUserWizard ID="CreateUserWizard1" runat="server">
<StepNavigationTemplate>
<asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Cancel" />
<asp:Button ID="StepNextButton" runat="server" CommandName="MoveNext" Text="I Agree" />
</StepNavigationTemplate>
<WizardSteps>
<asp:WizardStep runat="server" Title="Agree to Terms of Use">
</asp:WizardStep>
</WizardSteps>
</asp:CreateUserWizard>
它在这里什么都不做,但是当我把它放在
中时,它工作了,但是它添加了导航按钮,而以前的按钮仍然在那里,所以它一点用处都没有。这个怎么用?你是说这样的话:
<WizardSteps>
<asp:WizardStep runat="server" Title="Your title" ID="wzsStep" StepType="Step"></asp:WizardStep >
.....
</WizardSteps>
<StepNavigationTemplate>
<asp:Button ID="uxPreviousStepBtn" Text="Previous" runat="server" CausesValidation="False"
Width="80" OnClick="uxPreviousStepBtn_Click" OnPreRender="uxPreviosStepBtn_PreRender" />
<asp:Button ID="uxNextStepBtn" Text="Next" runat="server" CausesValidation="True"
Width="80" ValidationGroup="MainData" OnClick="uxNextStepBtn_Click" OnPreRender="uxNextStepBtn_PreRender" />
</StepNavigationTemplate>
protected void uxPreviousStepBtn_Click(object sender, EventArgs e)
{
//Previous step will show
myWizard.ActiveStepIndex =myWizard.ActiveStepIndex>0? myWizard.ActiveStepIndex-1:0;
}
protected void uxNextStepBtn_PreRender(object sender, EventArgs e)
{
//Check please if next step exists
myWizard.ActiveStepIndex =myWizard.ActiveStepIndex+1;
}
.....
受保护的void uxPreviousStepBtn_单击(对象发送方,事件参数e)
{
//将显示上一步
myWizard.ActiveStepIndex=myWizard.ActiveStepIndex>0?myWizard.ActiveStepIndex-1:0;
}
受保护的void uxNextStepBtn_PreRender(对象发送方,事件参数e)
{
//请检查是否存在下一步
myWizard.ActiveStepIndex=myWizard.ActiveStepIndex+1;
}
由于某些原因,我的问题中没有出现我的代码示例。。但现在是这样。我需要额外的代码/函数吗?我的印象是,只要有模板就足以覆盖默认的步骤模板(文档似乎就是这么暗示的)