Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net StepNavigationTemplate在CreateUserWizard内不工作?_Asp.net_Templates_Createuserwizard - Fatal编程技术网

Asp.net StepNavigationTemplate在CreateUserWizard内不工作?

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

我正在尝试设置StepNavigationTemplate,但它不起作用

<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;
}

由于某些原因,我的问题中没有出现我的代码示例。。但现在是这样。我需要额外的代码/函数吗?我的印象是,只要有模板就足以覆盖默认的步骤模板(文档似乎就是这么暗示的)