|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Validation Groups and Wizard stepHi;
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 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 The problem is that the wizard Next button is not available.
-- Show quoteHide quotethanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm "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 > > 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. 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. -- Show quoteHide quotethanks - dave david_at_windward_dot_net http://www.windwardreports.com Cubicle Wars - http://www.windwardreports.com/film.htm "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. > > 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.
Global resources not localized on IIS
How can validator code get the FormView data object Using Custom Control in a FormView Using Ajax control in custom server control How to show initial default values in a detailsview form Can I Use RequiredFieldValidator inside a repeater ? Why can't I get the FormView control's Paging controls to show? Have validators take up no space if control is valid Checkboxlist Question web control with GDI+ and MouseMovements. |
|||||||||||||||||||||||