Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. dropdown list

dropdown list

Scheduled Pinned Locked Moved ASP.NET
questionjavascriptsysadminxml
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    billcodes
    wrote on last edited by
    #1

    hi, I have 2 dropdownlists-one for the selecting country and another for states.When I select a country from the first dropdownlist,the second dropdownlist should show the corresponding states to be selected.I want to do this without postback to the server.How can I do this?Should I use javascript and xml?Please,explain in detail with source code. Regards, Bill

    S S C 3 Replies Last reply
    0
    • B billcodes

      hi, I have 2 dropdownlists-one for the selecting country and another for states.When I select a country from the first dropdownlist,the second dropdownlist should show the corresponding states to be selected.I want to do this without postback to the server.How can I do this?Should I use javascript and xml?Please,explain in detail with source code. Regards, Bill

      S Offline
      S Offline
      somasekhara777
      wrote on last edited by
      #2

      hi dear. give database connections properly. when select the country then all fields in state will be selected. take different tables for states. thank you

      j somasekhar

      1 Reply Last reply
      0
      • B billcodes

        hi, I have 2 dropdownlists-one for the selecting country and another for states.When I select a country from the first dropdownlist,the second dropdownlist should show the corresponding states to be selected.I want to do this without postback to the server.How can I do this?Should I use javascript and xml?Please,explain in detail with source code. Regards, Bill

        S Offline
        S Offline
        sudhanvag
        wrote on last edited by
        #3

        You can use Ajax. Use AjaxControlToolKit[^], where in you can place server side controls in UpdatePanel, and write serverside code. Thus you can avoid postbacks. I hope this helps you. Cheers, Sudhanva

        1 Reply Last reply
        0
        • B billcodes

          hi, I have 2 dropdownlists-one for the selecting country and another for states.When I select a country from the first dropdownlist,the second dropdownlist should show the corresponding states to be selected.I want to do this without postback to the server.How can I do this?Should I use javascript and xml?Please,explain in detail with source code. Regards, Bill

          C Offline
          C Offline
          CooperWu
          wrote on last edited by
          #4

          store two tables data in some variables when page is loading. then use javascript to change items in second dropdownlist. here are steps: 1. store country and state data in two hidden fields, or two variables in JavaScript. 2. write function to change items in second dropdownlist. ... Changing Select element content on the fly [^]

          Glad to discuss with you and best wishes.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups