Validation Summary isn't working...

Discussion in 'ASP .Net' started by Steve Nobody, Feb 22, 2010.

  1. Steve Nobody

    Steve Nobody Guest

    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
    Steve Nobody, Feb 22, 2010
    #1
    1. Advertising

  2. "Steve Nobody" <> wrote in message
    news:...
    > 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
    >
    Ananth Ramasamy Meenachi, Feb 23, 2010
    #2
    1. Advertising

  3. 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" <> wrote in message
    news:...
    > 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
    >
    Ananth Ramasamy Meenachi, Feb 23, 2010
    #3
  4. Steve Nobody

    qvo178

    Joined:
    Aug 28, 2008
    Messages:
    19
    Have you tell it to display in the summary group yet?
    qvo178, Feb 23, 2010
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Libs
    Replies:
    0
    Views:
    1,492
  2. D. Shane Fowlkes
    Replies:
    2
    Views:
    5,917
    Martin Dechev
    Feb 23, 2004
  3. Lucas Tam
    Replies:
    2
    Views:
    1,108
    Lucas Tam
    Feb 26, 2004
  4. =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=

    Using Summary Validation control with server Custom validation

    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=, Oct 15, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    880
    =?Utf-8?B?QmFyYmFyYSBBbGRlcnRvbg==?=
    Oct 15, 2004
  5. Replies:
    1
    Views:
    3,777
    bruce barker
    Dec 12, 2008
Loading...

Share This Page