"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. Advertising

  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. 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. mg
    Replies:
    0
    Views:
    337
  2. Ralph
    Replies:
    0
    Views:
    922
    Ralph
    Jan 18, 2004
  3. Kenneth McDonald
    Replies:
    2
    Views:
    384
    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:
    546
    Peter Hansen
    Dec 7, 2005
  5. Replies:
    10
    Views:
    620
    Seashor
    May 15, 2007
Loading...

Share This Page