"extract" info from ValidationSummary

Discussion in 'ASP .Net Web Controls' started by mg, Dec 15, 2003.

  1. mg

    mg Guest

    Is it possible to "extract" the error messages from the
    ValidationSummary in a WebForm. I'd like to use these
    strings elsewhere.

    If so, is there a [C#] code example of this?
     
    mg, Dec 15, 2003
    #1
    1. Advertisements

  2. mg

    Teemu Keiski Guest

    Hi,

    why validation summary? Do you need to reuse the messages at client-side? At
    server-side you can loop through Page.Validators collection and at
    client-side through the validator references stored in Page_Validators array

    <script language="javascript">
    <!--
    var Page_Validators = new Array(document.all["RequiredFieldValidator1"]);
    // -->
    </script>

    You just need to dig the error messages by checking the isvalid property ig
    yo8 want only the erroneus ones.
    Certainly you could also just try to get the innerText of the client-side
    element the ValidationSummary renders.

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


    "mg" <> wrote in message
    news:084d01c3c33c$0c500250$...
    > Is it possible to "extract" the error messages from the
    > ValidationSummary in a WebForm. I'd like to use these
    > strings elsewhere.
    >
    > If so, is there a [C#] code example of this?
     
    Teemu Keiski, Dec 16, 2003
    #2
    1. Advertisements

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. mg
    Replies:
    0
    Views:
    407
  2. Ralph
    Replies:
    0
    Views:
    1,049
    Ralph
    Jan 18, 2004
  3. Kenneth McDonald
    Replies:
    2
    Views:
    529
    Thomas Guettler
    Jun 21, 2004
  4. Laszlo Zsolt Nagy

    extract python install info from registry

    Laszlo Zsolt Nagy, Dec 6, 2005, in forum: Python
    Replies:
    8
    Views:
    714
    Peter Hansen
    Dec 7, 2005
  5. Replies:
    10
    Views:
    706
    Seashor
    May 15, 2007
  6. JS
    Replies:
    3
    Views:
    2,055
    Martin Honnen
    Apr 9, 2009
  7. Guest

    Extract EPS info?

    Guest, May 14, 2009, in forum: Python
    Replies:
    0
    Views:
    486
    Guest
    May 14, 2009
  8. Sinex

    Extract client certificate info...

    Sinex, Jun 18, 2007, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    512
    Sinex
    Jun 19, 2007
Loading...