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 Event Related Query

DropDown Event Related Query

Scheduled Pinned Locked Moved ASP.NET
databasejavascripthelptutorialquestion
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.
  • P Offline
    P Offline
    param thaker
    wrote on last edited by
    #1

    Hi Friends , I have 2 dropdown on my webpage . I am taking the index value from one dropdown using javascript , so i have make the AutoPostback Event property off for that dropdown control . Now , i want to fill the another dropdown , by filtering on the basis of value selected from first dropdown. Can you please guide me , for above problem? Thanking You, Param

    param

    S 1 Reply Last reply
    0
    • P param thaker

      Hi Friends , I have 2 dropdown on my webpage . I am taking the index value from one dropdown using javascript , so i have make the AutoPostback Event property off for that dropdown control . Now , i want to fill the another dropdown , by filtering on the basis of value selected from first dropdown. Can you please guide me , for above problem? Thanking You, Param

      param

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

      You can write following code on SelectedIndexChanged event of first dropdown list. and then load the data based on first dropdown's detail. and in second drop down keep AutoPostback off. /***************************** Code ************************************* Protected Sub Dropdown1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles SelectCmpCmb.SelectedIndexChanged Dim str As String str = "Select CompanyName from Company where CompanyName = '" & dropdown1.Text & "'" (Name of your first dropdown list) dropdown2.DataSource = dbaccess.ExecuteDataReader(str) dropdown2.DataTextField = "GroupName" dropdown2.DataBind() End Sub Note : Here dropdown1 is name of first dropdown list. and dropdown2 is name of second dropdown list. I hope this will help you.

      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