Home All Groups Group Topic Archive Search About

Validation Groups and Wizard step

Author
23 Jan 2007 12:31 AM
David Thielen
Hi;

In a wizard step I have two validation groups. I need one of them tied to
the Next button for that step only. How can I do this?

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Author
23 Jan 2007 4:18 AM
bhavesh
hi David,

If u r using ASP.NET 2.0 then u can have the validationgroup property
of button.

so For Ex.

If you have following two requiredfield validators...

<asp:reqfva id="test1"  runat="server" validationgroup="Group1"
controltovalidate="txt1">
<asp:reqfva id="test1"  runat="server" validationgroup="Group2"
controltovalidate="txt2">

now if u will define a button like

<asp:button id="button1" runat="server" Text="test"
validationgroup="Group1">

Now when u will press "test" button then u will get ur validator firing
for only txt1.

execuse for syntax.

hop this will help.

u can ask for any further query.





David Thielen wrote:
Show quoteHide quote
> Hi;
>
> In a wizard step I have two validation groups. I need one of them tied to
> the Next button for that step only. How can I do this?
>
> --
> thanks - dave
> david_at_windward_dot_net
> http://www.windwardreports.com
>
> Cubicle Wars - http://www.windwardreports.com/film.htm
Author
23 Jan 2007 5:06 AM
David Thielen
The problem is that the wizard Next button is not available.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Show quoteHide quote
"bhavesh" wrote:

> hi David,
>
> If u r using ASP.NET 2.0 then u can have the validationgroup property
> of button.
>
> so For Ex.
>
> If you have following two requiredfield validators...
>
>  <asp:reqfva id="test1"  runat="server" validationgroup="Group1"
> controltovalidate="txt1">
>  <asp:reqfva id="test1"  runat="server" validationgroup="Group2"
> controltovalidate="txt2">
>
> now if u will define a button like
>
> <asp:button id="button1" runat="server" Text="test"
> validationgroup="Group1">
>
> Now when u will press "test" button then u will get ur validator firing
> for only txt1.
>
> execuse for syntax.
>
> hop this will help.
>
> u can ask for any further query.
>
>
>
>
>
> David Thielen wrote:
> > Hi;
> >
> > In a wizard step I have two validation groups. I need one of them tied to
> > the Next button for that step only. How can I do this?
> >
> > --
> > thanks - dave
> > david_at_windward_dot_net
> > http://www.windwardreports.com
> >
> > Cubicle Wars - http://www.windwardreports.com/film.htm
>
>
Author
23 Jan 2007 9:23 AM
Walter Wang [MSFT]
Dave,

You could define your own controls for the step navigation template:

            <StepNavigationTemplate>
                <asp:Button ID="prevButton" runat="server"
CommandName="MovePrevious" Text="Prev" />
                <asp:Button ID="nextButton" runat="server"
CommandName="MoveNext" Text="Next" ValidationGroup="Test" />
            </StepNavigationTemplate>


===============
#Wizard.StepNavigationTemplate Property (System.Web.UI.WebControls)
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.wizard.st
epnavigationtemplate.aspx

The StepNavigationTemplate object that is contained in the
StepNavigationTemplate property must contain two IButtonControl controls,
one with its CommandName property set to "MoveNext" and one with its
CommandName property set to "MovePrevious", to enable the navigation
feature.

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


Hope this helps.

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Author
23 Jan 2007 5:49 PM
David Thielen
Found a good solution - in the next handler I call:

    private bool GroupIsValid(string name)
    {
        bool rtn = true;
        ValidatorCollection validators = Page.GetValidators(name);
        foreach (IValidator val in validators)
        {
            val.Validate();
            if (!val.IsValid)
                rtn = false;
        }
        return rtn;
    }

And call cancel if there was an error. It then shows the validator messages.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm




Show quoteHide quote
"Walter Wang [MSFT]" wrote:

> Dave,
>
> You could define your own controls for the step navigation template:
>
>             <StepNavigationTemplate>
>                 <asp:Button ID="prevButton" runat="server"
> CommandName="MovePrevious" Text="Prev" />
>                 <asp:Button ID="nextButton" runat="server"
> CommandName="MoveNext" Text="Next" ValidationGroup="Test" />
>             </StepNavigationTemplate>
>
>
> ===============
> #Wizard.StepNavigationTemplate Property (System.Web.UI.WebControls)
> http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.wizard.st
> epnavigationtemplate.aspx
>
> The StepNavigationTemplate object that is contained in the
> StepNavigationTemplate property must contain two IButtonControl controls,
> one with its CommandName property set to "MoveNext" and one with its
> CommandName property set to "MovePrevious", to enable the navigation
> feature.
>
> ===============
>
>
> Hope this helps.
>
> Regards,
> Walter Wang (waw***@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
>
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
Author
24 Jan 2007 12:26 AM
Walter Wang [MSFT]
Good solution. Thank you for sharing in the community.

Regards,
Walter Wang (waw***@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

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