Seemed like a great idea and when I tried it I still received the error message. I have similar to what others said yet same error. I have an update panel around a wizard control. Nothing fancy. Step 1 has required fields, no problem with validation. Step 2 has validation control. Error identical to 1st post.
Made the validationgroup for the validationsummary and set this in the requiredfieldvalidator control. Tried what Matt wrote but this didn't work. This is all with the latest release v1.0.
Anyone have an idea of what may be causing this and a possible solution?
thanks ^_^
Matt M:
If you make the validators group validators, the error will disappear and the wizard will work as expected.
This will work fine:
<asp:TextBox runat="server" ID="AddressLine1TextBox" Width="90%" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="An address is required." ValidationGroup="page1"
ControlToValidate="AddressLine1TextBox" SetFocusOnError="true" />
While this will crash and burn:
<asp:TextBox runat="server" ID="AddressLine1TextBox" Width="90%" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ErrorMessage="An address is required." ControlToValidate="AddressLine1TextBox" SetFocusOnError="true" />
To make sure they fire as required, modify the ActiveStepChanged or SideBarButtonClick functions. For example:
Protected Sub NewFormWizard_SideBarButtonClick(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.WizardNavigationEventArgs) _
Handles NewFormWizard.SideBarButtonClick
If e.NextStepIndex > e.CurrentStepIndex Then
Validate("page1")
If Not Page.IsValid() Then
e.Cancel = True
Else
' we need to explicitly set this to false
e.Cancel = False
End If
End If
End Sub The first IF statement is to allow users to go backwards in the wizard without forcing them to fill out the current page. Most of the info here was gathered from a post on the forums: http://forums.asp.net/thread/1385194.aspx .