Custom Validator Event Executes but does stop or disaplay error

Discussion in 'ASP .Net Web Controls' started by NRao, Mar 9, 2007.

  1. NRao

    NRao Guest

    Hello,

    I am using a custom validator control and wanted to validate server side and
    do not have client side validation function. The server side event executes
    but does not stop the page or does not display the error.

    <asp:CustomValidator id="custWDEndDate" runat="server"
    ControlToValidate="txtPickupDate" ErrorMessage="Not
    Valid" EnableClientScript="False"
    OnServerValidate="custWDEndDate_ServerValidate"></asp:CustomValidator>

    protected void custWDEndDate_ServerValidate(object source,
    System.Web.UI.WebControls.ServerValidateEventArgs args)
    {
    args.IsValid = false;
    }


    Any ideas
    NRao, Mar 9, 2007
    #1
    1. Advertising

  2. "NRao" <> wrote in message
    news:...
    > Hello,
    >
    > I am using a custom validator control and wanted to validate server side
    > and
    > do not have client side validation function. The server side event
    > executes
    > but does not stop the page or does not display the error.
    >
    > <asp:CustomValidator id="custWDEndDate" runat="server"
    > ControlToValidate="txtPickupDate" ErrorMessage="Not
    > Valid" EnableClientScript="False"
    > OnServerValidate="custWDEndDate_ServerValidate"></asp:CustomValidator>
    >
    > protected void custWDEndDate_ServerValidate(object source,
    > System.Web.UI.WebControls.ServerValidateEventArgs args)
    > {
    > args.IsValid = false;
    > }
    >


    It's not meant to stop the page or display an error. You're meant to check
    Page.IsValid and then decide what you want to do if the page is not valid.

    John
    John Saunders, Mar 9, 2007
    #2
    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. =?Utf-8?B?cG11ZA==?=
    Replies:
    8
    Views:
    792
    =?Utf-8?B?cG11ZA==?=
    Feb 11, 2005
  2. Joe Vasher
    Replies:
    3
    Views:
    1,074
    Joe Vasher
    May 13, 2004
  3. Replies:
    3
    Views:
    363
    Greg9Strat
    Jun 23, 2006
  4. ilyas
    Replies:
    0
    Views:
    692
    ilyas
    Jul 25, 2009
  5. JVRudnick

    CDOSYS executes but takes TOO TOO long?

    JVRudnick, Feb 20, 2008, in forum: ASP General
    Replies:
    13
    Views:
    280
    JVRudnick
    Feb 28, 2008
Loading...

Share This Page