how to iterate over a single dropdownlist in asp.net(vb language)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • davidson1
    New Member
    • Feb 2008
    • 144

    how to iterate over a single dropdownlist in asp.net(vb language)

    Hello to Everybody,

    I have a dropdownlist by name "Subject" which contain C,C++,Java,Php
    which is added by the following way

    subject.items.a dd("C")
    subject.items.a dd("C++")
    subject.items.a dd("Java")
    subject.items.a dd("Php")

    In the same webform

    i have a Textbox in that when user enter C or C++ or Java or Php

    i have to check this textbox text with Subject dropdownlist(No rmally Compare with every subject dropdownlist items)

    and Say this

    This Subject C or C++ or Java or Php have been entered in Subject dropdownlist... ..

    pl help me



    I just now send this post i got one reply to use subject.findbyt ext but it is not worked......... ...

    if anybody know any other coding sent me............. ......



    it shows an error

    Findbytext is not a member of dropdownlist

    if we should import any namespace , just tell me............ or if u know any other coding just tell me............. .............

    Davidson

    Posted Date:- 19 feb 2008
  • kunal pawar
    Contributor
    • Oct 2007
    • 297

    #2
    u can used loop and checked in every item of subject
    like
    Dim i as integer
    for i=0 to subject.length-1
    Response.write( subject.item(i) .text)
    next

    Comment

    Working...