473,396 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1785
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: newusertodotnet | last post by:
I'm trying to add a ValidationSummary control to a common base page used by all of our system's aspx/ascx files. The base page is a regular class file that inherits from System.Web.UI.Page. When I...
0
by: John Mabbott | last post by:
Hello all, We're getting some weird behavior with the ValidationSummary control. If I submit a page that fires some validators, the ValidationSummary displays them correctly. However, if I...
3
by: Christer | last post by:
Hi all! I recently created a MessageBox webcontrol for asp.net. This can be used as is, but I also want to take ude of it in other webcontrols. Right now i creating a ValidationSummary control,...
1
by: mg | last post by:
Is there a way to include in a ValidationSummary an error message that says that an exception was thrown or that an if/else test went to 'else' ?
2
by: Sunil Sabir | last post by:
Dear All, I am using ValidationSummary,RequiredField Validator and Regular Expression Validator in my ASP.net form. I want to display error messages only in the ValidationSummary Control. But...
1
by: SMG | last post by:
Hi All. My forms has two textboxes, 1 username, 2 password. Both has requiredfield validator it works fine when there is no input in these textboxes. And the errorMsg is shown in...
1
by: Dan Sikorsky | last post by:
I'm using SmartNavigation and need to automatically scroll to the top of the page when the ValidationSummary control catches errors and displays them, so that the user can see the errors without...
1
by: Ken Varn | last post by:
If a page has multiple ValidationSummary controls, how does it distinguish which ValidationControls are associated with which ValidationSummary controls? The reason I am asking this is that I...
0
by: Code Rodent | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.