Hi...

Last post 05-16-2008 1:15 AM by dinesh_sp. 1 replies.

Sort Posts:

  • Hi...

    05-15-2008, 11:14 PM
    • Member
      2 point Member
    • Lucky_007
    • Member since 05-05-2008, 4:33 AM
    • Sri Lanka
    • Posts 4

    Hi everybody... I need all of urs help.

    I need to validate a dropdownList in asp.net. From the list of items in the dropdown, when a specific item selected i need to give an error notification saying "this item is not valid".

    Ex:- letz say these are the names in the list.  "Mark" , "Brayan", "Kate", "Loren"

    What i wanna do is when i select "Kate" the error notification should appear in the UI.

    Help me soon....

     

  • Re: Hi...

    05-16-2008, 1:15 AM
    Answer
    • Contributor
      2,254 point Contributor
    • dinesh_sp
    • Member since 12-03-2007, 12:41 AM
    • Melbourne
    • Posts 409

    Hi, it can be done using Custom Validator. The code is as follows

    <Script language="javascript">
    function validateDropdownlist(src, args)

        {
         args.IsValid = (args.Value=='Kate');
        }

    </Script>

    Hope this helps.

Page 1 of 1 (2 items)