Wizard previous/next-buttons and validation

Discussion in 'ASP .Net Web Controls' started by orjanz, Jan 25, 2008.

  1. orjanz

    orjanz Guest

    Hi.
    I'm using the Wizard-control on some of my web-pages and have discovered
    that validation I have put on my controls don't fire when I click the
    previous-button. Only on the next- button. I haven't found out how to access
    these buttons within the Wizard to maybe set CauseValidation=True or
    something like that. How can I get the Wizard/Previous-button to also cause
    validation?

    Best regards,
    Ørjan Midttun
    Mercatus AS
    Norway
    orjanz, Jan 25, 2008
    #1
    1. Advertising

  2. Hi,

    Regarding on the Wizard control validation issue, I think it is due to the
    StepNavigation buttons(move previous and move next) are set to
    "CauseValidation=False" by default. And since Wizard control uses fixed
    stepNavigation template by default, you can not direclty access them.
    However, it provide you the feature to convert the default one to an
    editable template. You can do this via the following steps:

    ** switch to design-view for the page
    ** choose the Wizard control
    ** in the Wizard's "Action List" dropdownlist(the arrow on the top right
    side), choose "Convert to StepNavigation template"

    After that, you can customize the navigation template (such as modify the
    Buttons' properties) e.g.

    =====================
    <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="1">
    <StepNavigationTemplate>
    <asp:Button ID="StepPreviousButton" runat="server"
    CausesValidation="True" CommandName="MovePrevious"
    Text="Previous" />
    <asp:Button ID="StepNextButton" runat="server"
    CommandName="MoveNext" Text="Next" CausesValidation="True" />
    </StepNavigationTemplate>
    <WizardSteps>
    <asp:WizardStep runat="server" Title="Step 1">
    </asp:WizardStep>
    <asp:WizardStep runat="server" Title="Step 2">
    </asp:WizardStep>
    </WizardSteps>
    </asp:Wizard>
    ======================

    You can also customize some other template (such as "StartNavigation" or
    "FinishNavigation" template the same way).

    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.

    ---------------------------------------
    >From: =?Utf-8?B?b3JqYW56?= <>
    >Subject: Wizard previous/next-buttons and validation
    >Date: Fri, 25 Jan 2008 00:37:01 -0800


    >
    >Hi.
    >I'm using the Wizard-control on some of my web-pages and have discovered
    >that validation I have put on my controls don't fire when I click the
    >previous-button. Only on the next- button. I haven't found out how to

    access
    >these buttons within the Wizard to maybe set CauseValidation=True or
    >something like that. How can I get the Wizard/Previous-button to also

    cause
    >validation?
    >
    >Best regards,
    >Ørjan Midttun
    >Mercatus AS
    >Norway
    >
    Steven Cheng[MSFT], Jan 28, 2008
    #2
    1. Advertising

  3. orjanz

    orjanz Guest

    Hi Steven,
    and thanks for the reply. It gave just what I needed.

    But as far as I could see it looks like move previous is by default False
    and move next is True. The move next button causes validation even if I
    haven't set CauseValidation=True on it...

    Best regards,
    Ørjan Midttun
    Mercatus AS
    Norway


    "Steven Cheng[MSFT]" wrote:

    > Hi,
    >
    > Regarding on the Wizard control validation issue, I think it is due to the
    > StepNavigation buttons(move previous and move next) are set to
    > "CauseValidation=False" by default. And since Wizard control uses fixed
    > stepNavigation template by default, you can not direclty access them.
    > However, it provide you the feature to convert the default one to an
    > editable template. You can do this via the following steps:
    >
    > ** switch to design-view for the page
    > ** choose the Wizard control
    > ** in the Wizard's "Action List" dropdownlist(the arrow on the top right
    > side), choose "Convert to StepNavigation template"
    >
    > After that, you can customize the navigation template (such as modify the
    > Buttons' properties) e.g.
    >
    > =====================
    > <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="1">
    > <StepNavigationTemplate>
    > <asp:Button ID="StepPreviousButton" runat="server"
    > CausesValidation="True" CommandName="MovePrevious"
    > Text="Previous" />
    > <asp:Button ID="StepNextButton" runat="server"
    > CommandName="MoveNext" Text="Next" CausesValidation="True" />
    > </StepNavigationTemplate>
    > <WizardSteps>
    > <asp:WizardStep runat="server" Title="Step 1">
    > </asp:WizardStep>
    > <asp:WizardStep runat="server" Title="Step 2">
    > </asp:WizardStep>
    > </WizardSteps>
    > </asp:Wizard>
    > ======================
    >
    > You can also customize some other template (such as "StartNavigation" or
    > "FinishNavigation" template the same way).
    >
    > Hope this helps.
    >
    > Sincerely,
    >
    > Steven Cheng
    >
    > Microsoft MSDN Online Support Lead
    >
    >
    >
    > ==================================================
    >
    > Get notification to my posts through email? Please refer to
    > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    > ications.
    >
    >
    >
    > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    > where an initial response from the community or a Microsoft Support
    > Engineer within 1 business day is acceptable. Please note that each follow
    > up response may take approximately 2 business days as the support
    > professional working with you may need further investigation to reach the
    > most efficient resolution. The offering is not appropriate for situations
    > that require urgent, real-time or phone-based interactions or complex
    > project analysis and dump analysis issues. Issues of this nature are best
    > handled working with a dedicated Microsoft Support Engineer by contacting
    > Microsoft Customer Support Services (CSS) at
    > http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >
    > ==================================================
    >
    >
    > This posting is provided "AS IS" with no warranties, and confers no rights.
    >
    > ---------------------------------------
    > >From: =?Utf-8?B?b3JqYW56?= <>
    > >Subject: Wizard previous/next-buttons and validation
    > >Date: Fri, 25 Jan 2008 00:37:01 -0800

    >
    > >
    > >Hi.
    > >I'm using the Wizard-control on some of my web-pages and have discovered
    > >that validation I have put on my controls don't fire when I click the
    > >previous-button. Only on the next- button. I haven't found out how to

    > access
    > >these buttons within the Wizard to maybe set CauseValidation=True or
    > >something like that. How can I get the Wizard/Previous-button to also

    > cause
    > >validation?
    > >
    > >Best regards,
    > >Ørjan Midttun
    > >Mercatus AS
    > >Norway
    > >

    >
    >
    orjanz, Jan 29, 2008
    #3
  4. Thanks for your reply Norway,

    I think MoveNext button(or normal submit button) use "CauseValidation=true"
    as default value.

    BTW, if you would, you can completely remove the original default template
    of the "StepNavigation" template and define your own. You can use code to
    navigate to previous or next step for your wizard control.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.


    --------------------
    >From: =?Utf-8?B?b3JqYW56?= <>
    >References: <>

    <>
    >Subject: RE: Wizard previous/next-buttons and validation
    >Date: Tue, 29 Jan 2008 02:21:01 -0800


    >
    >Hi Steven,
    >and thanks for the reply. It gave just what I needed.
    >
    >But as far as I could see it looks like move previous is by default False
    >and move next is True. The move next button causes validation even if I
    >haven't set CauseValidation=True on it...
    >
    >Best regards,
    >Ørjan Midttun
    >Mercatus AS
    >Norway
    >
    >
    >"Steven Cheng[MSFT]" wrote:
    >
    >> Hi,
    >>
    >> Regarding on the Wizard control validation issue, I think it is due to

    the
    >> StepNavigation buttons(move previous and move next) are set to
    >> "CauseValidation=False" by default. And since Wizard control uses fixed
    >> stepNavigation template by default, you can not direclty access them.
    >> However, it provide you the feature to convert the default one to an
    >> editable template. You can do this via the following steps:
    >>
    >> ** switch to design-view for the page
    >> ** choose the Wizard control
    >> ** in the Wizard's "Action List" dropdownlist(the arrow on the top right
    >> side), choose "Convert to StepNavigation template"
    >>
    >> After that, you can customize the navigation template (such as modify

    the
    >> Buttons' properties) e.g.
    >>
    >> =====================
    >> <asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="1">
    >> <StepNavigationTemplate>
    >> <asp:Button ID="StepPreviousButton" runat="server"
    >> CausesValidation="True" CommandName="MovePrevious"
    >> Text="Previous" />
    >> <asp:Button ID="StepNextButton" runat="server"
    >> CommandName="MoveNext" Text="Next" CausesValidation="True" />
    >> </StepNavigationTemplate>
    >> <WizardSteps>
    >> <asp:WizardStep runat="server" Title="Step 1">
    >> </asp:WizardStep>
    >> <asp:WizardStep runat="server" Title="Step 2">
    >> </asp:WizardStep>
    >> </WizardSteps>
    >> </asp:Wizard>
    >> ======================
    >>
    >> You can also customize some other template (such as "StartNavigation" or
    >> "FinishNavigation" template the same way).
    >>
    >> Hope this helps.
    >>
    >> Sincerely,
    >>
    >> Steven Cheng
    >>
    >> Microsoft MSDN Online Support Lead
    >>
    >>
    >>
    >> ==================================================
    >>
    >> Get notification to my posts through email? Please refer to
    >>

    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    >> ications.
    >>
    >>
    >>
    >> Note: The MSDN Managed Newsgroup support offering is for non-urgent

    issues
    >> where an initial response from the community or a Microsoft Support
    >> Engineer within 1 business day is acceptable. Please note that each

    follow
    >> up response may take approximately 2 business days as the support
    >> professional working with you may need further investigation to reach

    the
    >> most efficient resolution. The offering is not appropriate for

    situations
    >> that require urgent, real-time or phone-based interactions or complex
    >> project analysis and dump analysis issues. Issues of this nature are

    best
    >> handled working with a dedicated Microsoft Support Engineer by

    contacting
    >> Microsoft Customer Support Services (CSS) at
    >> http://msdn.microsoft.com/subscriptions/support/default.aspx.
    >>
    >> ==================================================
    >>
    >>
    >> This posting is provided "AS IS" with no warranties, and confers no

    rights.
    >>
    >> ---------------------------------------
    >> >From: =?Utf-8?B?b3JqYW56?= <>
    >> >Subject: Wizard previous/next-buttons and validation
    >> >Date: Fri, 25 Jan 2008 00:37:01 -0800

    >>
    >> >
    >> >Hi.
    >> >I'm using the Wizard-control on some of my web-pages and have

    discovered
    >> >that validation I have put on my controls don't fire when I click the
    >> >previous-button. Only on the next- button. I haven't found out how to

    >> access
    >> >these buttons within the Wizard to maybe set CauseValidation=True or
    >> >something like that. How can I get the Wizard/Previous-button to also

    >> cause
    >> >validation?
    >> >
    >> >Best regards,
    >> >Ørjan Midttun
    >> >Mercatus AS
    >> >Norway
    >> >

    >>
    >>

    >
    Steven Cheng[MSFT], Jan 30, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Psybar Phreak

    previous & next buttons

    Psybar Phreak, Oct 11, 2003, in forum: Perl
    Replies:
    3
    Views:
    472
  2. David
    Replies:
    1
    Views:
    371
    =?Utf-8?B?SEFSSSBQUkFTRCBCQVJV?=
    Oct 27, 2004
  3. msnews
    Replies:
    4
    Views:
    1,781
  4. Roger23
    Replies:
    0
    Views:
    3,293
    Roger23
    Mar 13, 2006
  5. shapper

    GridView Next / Previous buttons

    shapper, Mar 22, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    524
Loading...

Share This Page