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. Populate a Dropdown list based on another one in VB.NET

Populate a Dropdown list based on another one in VB.NET

Scheduled Pinned Locked Moved ASP.NET
tutorialcsharpdatabasesysadmin
2 Posts 2 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.
  • H Offline
    H Offline
    hm9
    wrote on last edited by
    #1

    Hi

    I want to be able to populate a drop down list based on the selection of another one or others using vb.net and also pass the value selected to another page or within the same page. for instance one drop down to select a country and a second one to populate the cities based on the first selection. I added one in the code below one below so need to add another one and populate it based on the selection in the first one. I am not using a Database. I just want the selection from the list as it is added manually.. Can you please advise of an example on how to achieve this or help exapand the code below . Thanks

    <Script Runat="Server">
    Sub Button_Click( s As Object, e As EventArgs )
    if IsValid then
    response.redirect ("test.aspx?id=" & countries.Text & " ")
    end if
    end sub
    </script>

    Select a Country France
     Spain
      USA
       Italy
      England
     
    
    
    </form>
    
    M 1 Reply Last reply
    0
    • H hm9

      Hi

      I want to be able to populate a drop down list based on the selection of another one or others using vb.net and also pass the value selected to another page or within the same page. for instance one drop down to select a country and a second one to populate the cities based on the first selection. I added one in the code below one below so need to add another one and populate it based on the selection in the first one. I am not using a Database. I just want the selection from the list as it is added manually.. Can you please advise of an example on how to achieve this or help exapand the code below . Thanks

      <Script Runat="Server">
      Sub Button_Click( s As Object, e As EventArgs )
      if IsValid then
      response.redirect ("test.aspx?id=" & countries.Text & " ")
      end if
      end sub
      </script>

      Select a Country France
       Spain
        USA
         Italy
        England
       
      
      
      </form>
      
      M Offline
      M Offline
      Md Marufuzzaman
      wrote on last edited by
      #2

      Hello, You can't do this smartly without any RDBMS / database table mapping on country with the cities to populate the list.

      Regards, Md. Marufuzzaman

      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