Results 1 to 3 of 3

Thread: How to get values in a dependent Drop down box (HTMLSelect)

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2004
    Posts
    23

    Unhappy How to get values in a dependent Drop down box (HTMLSelect)

    Hi,
    I'm using two drop down boxes, one for state and one for city. Based on what State the user selects, I want my city list to be populated from the database. I can populate a single list from the database on page load but I can't get this to work. What I want is that the onChange event handler should fire. but it doesn't. Also both State and City controls are server controls.
    I found some info regarding how to do this in ASP but I'm using ASP.NET.
    Does anyone know how to get this work?
    Thanks in advance.

  2. #2
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    Re: How to get values in a dependent Drop down box (HTMLSelect)

    Hi, is the AutoPostBack set to true for the drop down box in question? Also, make sure the code to populate the 2nd combo box is located under SelectedIndexChanged.
    David Wilhelm

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Dec 2004
    Posts
    23

    Re: How to get values in a dependent Drop down box (HTMLSelect)

    Thanks, I got it working by setting autopostback to true.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width