Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Validation Summary isn't working...

Reply
Thread Tools

Validation Summary isn't working...

 
 
Steve Nobody
Guest
Posts: n/a
 
      02-22-2010
I am creating a dynamic form with dynamic regular expression
validators...

RegularExpressionValidator oRV = new RegularExpressionValidator();


oRV.ID = "RV_" + oTB.ID;
oRV.ControlToValidate = oTB.ID;
oRV.ValidationExpression = "^\\d+$";
oRV.Display = ValidatorDisplay.Dynamic;
oRV.ErrorMessage = "Must be numeric.";
oRV.Text = "*";
oRV.ValidationGroup = "AnnualForm";
oRV.ForeColor = System.Drawing.Color.Red;
oRV.EnableClientScript = true;
oRV.EnableViewState = true;


oCell.Controls.Add(oRV);


and trying to use the following ValidationSummary....


<asp:ValidationSummary ID="ValSummary1" runat="server"
EnableClientScript="true" Enabled="true" ShowMessageBox="true"
ShowSummary="true" ValidationGroup="AnnualForm"
DisplayMode="BulletList" />


The "*" display by each textbox they are grouped with, but the
validationsummary does nothing. I have tried various display modes
and
still no change. I am using .net 2.0. Any suggestions?


Steve
 
Reply With Quote
 
 
 
 
Ananth Ramasamy Meenachi
Guest
Posts: n/a
 
      02-23-2010


"Steve Nobody" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am creating a dynamic form with dynamic regular expression
> validators...
>
> RegularExpressionValidator oRV = new RegularExpressionValidator();
>
>
> oRV.ID = "RV_" + oTB.ID;
> oRV.ControlToValidate = oTB.ID;
> oRV.ValidationExpression = "^\\d+$";
> oRV.Display = ValidatorDisplay.Dynamic;
> oRV.ErrorMessage = "Must be numeric.";
> oRV.Text = "*";
> oRV.ValidationGroup = "AnnualForm";
> oRV.ForeColor = System.Drawing.Color.Red;
> oRV.EnableClientScript = true;
> oRV.EnableViewState = true;
>
>
> oCell.Controls.Add(oRV);
>
>
> and trying to use the following ValidationSummary....
>
>
> <asp:ValidationSummary ID="ValSummary1" runat="server"
> EnableClientScript="true" Enabled="true" ShowMessageBox="true"
> ShowSummary="true" ValidationGroup="AnnualForm"
> DisplayMode="BulletList" />
>
>
> The "*" display by each textbox they are grouped with, but the
> validationsummary does nothing. I have tried various display modes
> and
> still no change. I am using .net 2.0. Any suggestions?
>
>
> Steve
>

 
Reply With Quote
 
 
 
 
Ananth Ramasamy Meenachi
Guest
Posts: n/a
 
      02-23-2010
You might be creating the validator in Page_Load and immediately attempting
to validate with it. Make sure you add the validator to the page, perhaps to
a PlaceHolder. Move your validation tests into the post back event handler
method (the Click event of the submit control). Then test Page.IsValid is
true.

Ananth Ramasamy Meenachi www.msarm.com

"Steve Nobody" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am creating a dynamic form with dynamic regular expression
> validators...
>
> RegularExpressionValidator oRV = new RegularExpressionValidator();
>
>
> oRV.ID = "RV_" + oTB.ID;
> oRV.ControlToValidate = oTB.ID;
> oRV.ValidationExpression = "^\\d+$";
> oRV.Display = ValidatorDisplay.Dynamic;
> oRV.ErrorMessage = "Must be numeric.";
> oRV.Text = "*";
> oRV.ValidationGroup = "AnnualForm";
> oRV.ForeColor = System.Drawing.Color.Red;
> oRV.EnableClientScript = true;
> oRV.EnableViewState = true;
>
>
> oCell.Controls.Add(oRV);
>
>
> and trying to use the following ValidationSummary....
>
>
> <asp:ValidationSummary ID="ValSummary1" runat="server"
> EnableClientScript="true" Enabled="true" ShowMessageBox="true"
> ShowSummary="true" ValidationGroup="AnnualForm"
> DisplayMode="BulletList" />
>
>
> The "*" display by each textbox they are grouped with, but the
> validationsummary does nothing. I have tried various display modes
> and
> still no change. I am using .net 2.0. Any suggestions?
>
>
> Steve
>

 
Reply With Quote
 
qvo178 qvo178 is offline
Junior Member
Join Date: Aug 2008
Posts: 29
 
      02-23-2010
Have you tell it to display in the summary group yet?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation Summary not showing for client side validation cwhankey@gmail.com ASP .Net 1 12-12-2008 02:32 AM
Using Summary Validation control with server Custom validation =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?= ASP .Net 2 10-15-2004 06:15 PM
Displaying a Validation Error in a Validation Summary Control Lucas Tam ASP .Net 2 02-26-2004 07:49 PM
Validation Summary zPaul ASP .Net 0 06-26-2003 07:54 PM
validation summary doesnt display when there's client-side validation Libs ASP .Net 0 06-25-2003 03:05 PM



Advertisments