469,927 Members | 1,835 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

ValidationSummary Issues

Hi there,

Please please could someone shed some like on a problem that I'm having
using a combination of Wizards, ValidationGroups and ValidationSummary
controls. What I want to do is to have a wizard that will take me through
several steps, and at each step validate input data using
RequiredFieldValidators etc. displaying any errors in a Validation Summary.
The problem that I have is that I cannot seem to have a ValidationSummary
control on each step of the wizard and get client side validation to take
place. If I remove the summary control from the second step of the wizard,
then all is well and client side validation takes place.

I've broken the problem down to it's most simple form see code below which
demonstrates the problem.

I've struggled for many hours to track the problem down to this, so I'm
hoping that some kind person can show me the error of my ways or provide an
acceptable work around. I do need to have the summary panel on each step
though, so thinking caps on..

Thanks in advance

Andy
<h1>If you can leave the edit control empty and click on the next button
then the client side validation is NOT working!</h1>

<asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="false">

<WizardSteps>

<asp:WizardStep runat="server" Title="Step 1">

</asp:WizardStep>

<asp:WizardStep runat="server" Title="Step 2">

</asp:WizardStep>

</WizardSteps>

<StartNavigationTemplate>

<asp:Label ID="_lblPostCode" runat="server"
AssociatedControlID="_txtPostCode">PostCode:</asp:Label>

<asp:TextBox ID="_txtPostCode" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="_txtPostCode"

ErrorMessage="A postcode need is required and must be in the form BN43 5HF."
ToolTip="A postcode is is required."

ValidationGroup="_register">*</asp:RequiredFieldValidator>

<asp:Button ID="Button1" runat="server" Text="Next" CommandName="MoveNext"
ValidationGroup="_register"/>

<asp:ValidationSummary ID="changePasswordSummary" runat="server"
ValidationGroup="_register" />

</StartNavigationTemplate>

<FinishNavigationTemplate>

<asp:Label ID="_lblExpiry" runat="server"
AssociatedControlID="_txtExpiry">Expiry:</asp:Label>

<asp:TextBox ID="_txtExpiry" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="_txtExpiry"

ErrorMessage="A card expiry date is required and must be in the form MM/YY."
ToolTip="A card expiry date is required."

ValidationGroup="_expiry">*</asp:RequiredFieldValidator>

<asp:Button ID="Button2" runat="server" Text="Finished"
CommandName="MoveEnd" ValidationGroup="_expiry"/>

<asp:ValidationSummary ID="changePasswordSummary" runat="server"
ValidationGroup="_expiry" />

</FinishNavigationTemplate>

</asp:Wizard>

May 3 '06 #1
2 1567
Why don't you move the validation summary outside the wizard control. try
that lets see if it works
"Code Rodent" <Co********@noemail.noemail.com> wrote in message
news:eY**************@TK2MSFTNGP05.phx.gbl...
Hi there,

Please please could someone shed some like on a problem that I'm having
using a combination of Wizards, ValidationGroups and ValidationSummary
controls. What I want to do is to have a wizard that will take me through
several steps, and at each step validate input data using
RequiredFieldValidators etc. displaying any errors in a Validation
Summary. The problem that I have is that I cannot seem to have a
ValidationSummary control on each step of the wizard and get client side
validation to take place. If I remove the summary control from the second
step of the wizard, then all is well and client side validation takes
place.

I've broken the problem down to it's most simple form see code below which
demonstrates the problem.

I've struggled for many hours to track the problem down to this, so I'm
hoping that some kind person can show me the error of my ways or provide
an acceptable work around. I do need to have the summary panel on each
step though, so thinking caps on..

Thanks in advance

Andy
<h1>If you can leave the edit control empty and click on the next button
then the client side validation is NOT working!</h1>

<asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="false">

<WizardSteps>

<asp:WizardStep runat="server" Title="Step 1">

</asp:WizardStep>

<asp:WizardStep runat="server" Title="Step 2">

</asp:WizardStep>

</WizardSteps>

<StartNavigationTemplate>

<asp:Label ID="_lblPostCode" runat="server"
AssociatedControlID="_txtPostCode">PostCode:</asp:Label>

<asp:TextBox ID="_txtPostCode" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="_txtPostCode"

ErrorMessage="A postcode need is required and must be in the form BN43
5HF." ToolTip="A postcode is is required."

ValidationGroup="_register">*</asp:RequiredFieldValidator>

<asp:Button ID="Button1" runat="server" Text="Next" CommandName="MoveNext"
ValidationGroup="_register"/>

<asp:ValidationSummary ID="changePasswordSummary" runat="server"
ValidationGroup="_register" />

</StartNavigationTemplate>

<FinishNavigationTemplate>

<asp:Label ID="_lblExpiry" runat="server"
AssociatedControlID="_txtExpiry">Expiry:</asp:Label>

<asp:TextBox ID="_txtExpiry" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="_txtExpiry"

ErrorMessage="A card expiry date is required and must be in the form
MM/YY." ToolTip="A card expiry date is required."

ValidationGroup="_expiry">*</asp:RequiredFieldValidator>

<asp:Button ID="Button2" runat="server" Text="Finished"
CommandName="MoveEnd" ValidationGroup="_expiry"/>

<asp:ValidationSummary ID="changePasswordSummary" runat="server"
ValidationGroup="_expiry" />

</FinishNavigationTemplate>

</asp:Wizard>

May 3 '06 #2
Unfortunately I cannot have the summary outside of the wizard control as it
would appear beneath the Next/Prev/Cancel buttons and look rather odd. I
have tried that and it does work, it's just not aesthetically pleasing.

Thanks all the same

Andy
"Onwuka Emeka" <bu******@hotmail.com> wrote in message
news:el*************@TK2MSFTNGP04.phx.gbl...
Why don't you move the validation summary outside the wizard control. try
that lets see if it works
"Code Rodent" <Co********@noemail.noemail.com> wrote in message
news:eY**************@TK2MSFTNGP05.phx.gbl...
Hi there,

Please please could someone shed some like on a problem that I'm having
using a combination of Wizards, ValidationGroups and ValidationSummary
controls. What I want to do is to have a wizard that will take me
through several steps, and at each step validate input data using
RequiredFieldValidators etc. displaying any errors in a Validation
Summary. The problem that I have is that I cannot seem to have a
ValidationSummary control on each step of the wizard and get client side
validation to take place. If I remove the summary control from the
second step of the wizard, then all is well and client side validation
takes place.

I've broken the problem down to it's most simple form see code below
which demonstrates the problem.

I've struggled for many hours to track the problem down to this, so I'm
hoping that some kind person can show me the error of my ways or provide
an acceptable work around. I do need to have the summary panel on each
step though, so thinking caps on..

Thanks in advance

Andy
<h1>If you can leave the edit control empty and click on the next button
then the client side validation is NOT working!</h1>

<asp:Wizard ID="Wizard1" runat="server" DisplaySideBar="false">

<WizardSteps>

<asp:WizardStep runat="server" Title="Step 1">

</asp:WizardStep>

<asp:WizardStep runat="server" Title="Step 2">

</asp:WizardStep>

</WizardSteps>

<StartNavigationTemplate>

<asp:Label ID="_lblPostCode" runat="server"
AssociatedControlID="_txtPostCode">PostCode:</asp:Label>

<asp:TextBox ID="_txtPostCode" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
ControlToValidate="_txtPostCode"

ErrorMessage="A postcode need is required and must be in the form BN43
5HF." ToolTip="A postcode is is required."

ValidationGroup="_register">*</asp:RequiredFieldValidator>

<asp:Button ID="Button1" runat="server" Text="Next"
CommandName="MoveNext" ValidationGroup="_register"/>

<asp:ValidationSummary ID="changePasswordSummary" runat="server"
ValidationGroup="_register" />

</StartNavigationTemplate>

<FinishNavigationTemplate>

<asp:Label ID="_lblExpiry" runat="server"
AssociatedControlID="_txtExpiry">Expiry:</asp:Label>

<asp:TextBox ID="_txtExpiry" runat="server"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"
ControlToValidate="_txtExpiry"

ErrorMessage="A card expiry date is required and must be in the form
MM/YY." ToolTip="A card expiry date is required."

ValidationGroup="_expiry">*</asp:RequiredFieldValidator>

<asp:Button ID="Button2" runat="server" Text="Finished"
CommandName="MoveEnd" ValidationGroup="_expiry"/>

<asp:ValidationSummary ID="changePasswordSummary" runat="server"
ValidationGroup="_expiry" />

</FinishNavigationTemplate>

</asp:Wizard>


May 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by John Mabbott | last post: by
3 posts views Thread by Christer | last post: by
2 posts views Thread by Sunil Sabir | last post: by
1 post views Thread by Ken Varn | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.