Displaying a Validation Error in a Validation Summary Control

Discussion in 'ASP .Net' started by Lucas Tam, Feb 26, 2004.

  1. Lucas Tam

    Lucas Tam Guest

    Hi all,


    I want to display an error message from a custom validator in my Validation
    Summary control.

    Do I need to build the ServerValidate Event handler in order to display an
    error message?

    All I wish to do is raise an error message on a failed database insert -
    can I just set cvMyCustomValidator.IsValid = False?

    Thanks.

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Feb 26, 2004
    #1
    1. Advertising

  2. Lucas Tam

    Teemu Keiski Guest

    If validation summary is in MessageBox mode, it won't show the message
    unless your custom validator works at client as well. At server side it is
    the setting of IsValid=false as you noted but it works only if validation
    summary has ShowSummary=True specified. Yes, it is specified in
    ServerValidate event handler.

    --
    Teemu Keiski
    MCP, Microsoft MVP (ASP.NET), AspInsiders member
    ASP.NET Forum Moderator, AspAlliance Columnist

    "Lucas Tam" <> wrote in message
    news:Xns949ADD0C2EC4Fnntprogerscom@140.99.99.130...
    > Hi all,
    >
    >
    > I want to display an error message from a custom validator in my

    Validation
    > Summary control.
    >
    > Do I need to build the ServerValidate Event handler in order to display an
    > error message?
    >
    > All I wish to do is raise an error message on a failed database insert -
    > can I just set cvMyCustomValidator.IsValid = False?
    >
    > Thanks.
    >
    > --
    > Lucas Tam ()
    > Please delete "REMOVE" from the e-mail address when replying.
    > http://members.ebay.com/aboutme/coolspot18/
    Teemu Keiski, Feb 26, 2004
    #2
    1. Advertising

  3. Lucas Tam

    Lucas Tam Guest

    "Teemu Keiski" <> wrote in news:uRHUj#C$DHA.808
    @TK2MSFTNGP12.phx.gbl:

    > At server side it is
    > the setting of IsValid=false as you noted but it works only if validation
    > summary has ShowSummary=True specified. Yes, it is specified in
    > ServerValidate event handler.
    >


    I can only seem to get my "dummy" validator to work if I have an event
    hanlder in place.

    Setting Isvalid=False alone doesn't seem to work...

    Is there a way I can insert an error message into the ValidationSummary
    without all the event handler code? (not much, but tedious). Thanks!

    --
    Lucas Tam ()
    Please delete "REMOVE" from the e-mail address when replying.
    http://members.ebay.com/aboutme/coolspot18/
    Lucas Tam, Feb 26, 2004
    #3
    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?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
  2. =?Utf-8?B?TWlrZSBNb29yZQ==?=

    Validation Summary Message Box Not Displaying

    =?Utf-8?B?TWlrZSBNb29yZQ==?=, Dec 7, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    4,960
    Patrick Olurotimi Ige
    Dec 9, 2004
  3. Bishop
    Replies:
    1
    Views:
    774
    Bishop
    Feb 24, 2007
  4. iHavAQuestion
    Replies:
    0
    Views:
    576
    iHavAQuestion
    Apr 28, 2008
  5. Chris Lane

    Validation Summary Control not displaying MessageBox

    Chris Lane, Nov 23, 2003, in forum: ASP .Net Web Controls
    Replies:
    11
    Views:
    301
    Chris Lane
    Nov 24, 2003
Loading...

Share This Page