I have tried setting it in the code and also in the markup but when the Next Button is clicked, the page is validated, I want to prevnt this from happening and control when validation should occur and when not. Any suggestions or code samples would be appreciated
Share
The easiest way to do this would be to remove all validator controls from the
WizardStepin which validation is to be skipped.However, if you need advanced functionality, you will need to set the
CausesValidationproperty of the Next/Previous buttons in yourStepNavigationTemplatemanually. The ASP.NET Wizard control does not expose properties that let you access the controls in the NavigationTemplates directly, nor does it expose any properties to access the NavigationTemplate. So, we need to rely on theFindControlmethod to do all the searching.A handy piece of information that I found while researching this problem was that at runtime the
StepNavigationTemplateis of an internal ASP.NET type calledStepNavigationTemplateContainerand has an ID “StepNavigationTemplateContainerID”. This enabled me to locate theStepNavigationTemplateand therefore, the Next Button.Code follows: