C# 如何在向导步骤中单击“上一步”时禁用页面验证

C# 如何在向导步骤中单击“上一步”时禁用页面验证,c#,asp.net,C#,Asp.net,当我尝试单击页面上向导步骤中的“上一页”按钮时,在所有字段都有效之前,它不会返回到上一页。我已经转向因果关系验证。向导中是否存在此问题?我的代码如下: <StepNavigationTemplate> <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious" Text="Previous" O

当我尝试单击页面上向导步骤中的“上一页”按钮时,在所有字段都有效之前,它不会返回到上一页。我已经转向因果关系验证。向导中是否存在此问题?我的代码如下:

<StepNavigationTemplate>
        <asp:Button ID="StepPreviousButton" runat="server" CausesValidation="False" CommandName="MovePrevious"
            Text="Previous" OnClientClick="DisableButton(this);" UseSubmitBehavior="False"
            CssClass="bigButton" />


干杯

你应该看看下面的问题。这说明了如何分步骤禁用验证。基本上,您必须在代码中处理它。

对于asp页面中的所有验证程序控件,请将它们设置为enabled=false。然后在“代码隐藏”中单击“下一步”按钮,或者单击希望验证器工作的任何按钮,将验证器设置为enabled=true

asp.net:

*

vb:


没用。CausesValidation设置为false,但它似乎只是忽略了它!似乎标记中的设置对那个人不起作用,必须在代码中完成。你试过了吗?是的,我就是这么做的。不走运。页面上是否有其他原因导致验证?
Protected Sub CreationWizard_NextButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) Handles CreationWizard.NextButtonClick
    If (CreationWizard.ActiveStepIndex = CreationWizard.WizardSteps.IndexOf(Me.WizardStep1)) Then
        TitleRequiredFieldValidator.Enabled = True

    End If