DropDownList Problem

Discussion in 'ASP .Net Web Controls' started by radhakrishnan, Jan 23, 2004.

  1. Hello All,

    In a webform i have one dropdownlist and One textbox

    user can select the particular item from the dropdownlist and
    enter value in the
    textbox.

    finally he click submit button the entered data are to stored in
    a database.


    ex. selection of first item in dropdownlist user enters the
    textbox1="HELLO"
    selection of second item in dropdown user enters the
    textbox1="WELCOME"
    Onclicking the submit button HELLO,WELCOME both should to be
    stored.

    I am making dropdownlist.AutoPostBack="true"
    To do this i am using the onselectedindexchanged as given below.

    dim htList as new Hashtable
    sub change(sender as object,e as eventagrs)
    textbox1.text="HELLO"
    htList.add(dropdownlist.selectedindex,textbox1.text)
    end sub

    i am using a hash table to store these values. But only the last
    selectedindex value is available in hashtable.
    Is there any way to get all the values entered by the user
    onselecedindexchaged.

    thanks in advance
     
    radhakrishnan, Jan 23, 2004
    #1
    1. Advertising

  2. radhakrishnan

    CMA Guest

    when u declare the variable use "Shared"

    like
    Shared htList as new Hashtable

    it will available as static. so make ur life easier...

    regards,
    CMA



    "radhakrishnan" <> wrote in message
    news:buq7ul$jbh$...
    > Hello All,
    >
    > In a webform i have one dropdownlist and One textbox
    >
    > user can select the particular item from the dropdownlist and
    > enter value in the
    > textbox.
    >
    > finally he click submit button the entered data are to stored

    in
    > a database.
    >
    >
    > ex. selection of first item in dropdownlist user enters the
    > textbox1="HELLO"
    > selection of second item in dropdown user enters the
    > textbox1="WELCOME"
    > Onclicking the submit button HELLO,WELCOME both should to be
    > stored.
    >
    > I am making dropdownlist.AutoPostBack="true"
    > To do this i am using the onselectedindexchanged as given below.
    >
    > dim htList as new Hashtable
    > sub change(sender as object,e as eventagrs)
    > textbox1.text="HELLO"
    > htList.add(dropdownlist.selectedindex,textbox1.text)
    > end sub
    >
    > i am using a hash table to store these values. But only the last
    > selectedindex value is available in hashtable.
    > Is there any way to get all the values entered by the user
    > onselecedindexchaged.
    >
    > thanks in advance
    >
    >
    >
    >
     
    CMA, Jan 23, 2004
    #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. mr2_93
    Replies:
    1
    Views:
    3,604
    mr2_93
    Oct 2, 2005
  2. tshad
    Replies:
    8
    Views:
    2,236
    tshad
    Oct 19, 2005
  3. =?Utf-8?B?SnVhbmpv?=

    GridView: Filtr DropDownList from another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 23, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,871
    =?Utf-8?B?SnVhbmpv?=
    Dec 23, 2005
  4. =?Utf-8?B?SnVhbmpv?=

    GridView: Filter DropDownList for another DropDownList

    =?Utf-8?B?SnVhbmpv?=, Dec 29, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,304
    =?Utf-8?B?SnVhbmpv?=
    Dec 29, 2005
  5. keithb
    Replies:
    1
    Views:
    12,014
    shauns1
    Nov 1, 2006
Loading...

Share This Page