Wizard previous/next-buttons and validation

O

orjanz

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
 
S

Steven Cheng[MSFT]

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.

---------------------------------------
 
O

orjanz

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
 
S

Steven Cheng[MSFT]

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?= <[email protected]>
References: <[email protected]>
Subject: RE: Wizard previous/next-buttons and validation
Date: Tue, 29 Jan 2008 02:21:01 -0800
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top