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. General Programming
  3. LINQ
  4. populating dropdownlist based on the selection of item from other dropdownlist in asp.net

populating dropdownlist based on the selection of item from other dropdownlist in asp.net

Scheduled Pinned Locked Moved LINQ
csharpasp-nethelpannouncement
2 Posts 2 Posters 2 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.
  • S Offline
    S Offline
    sowmya k
    wrote on last edited by
    #1

    Am new to asp.net, I have created to dropdownlist named country and district and binded the data for each dropdownlist from two different tables called tblcountry and tbldistrict When the county changes in Country dropdownlist, I want the district dropdown to automatically update with a list of districts in that country. can anyone help me.. Thanks in Advance

    H 1 Reply Last reply
    0
    • S sowmya k

      Am new to asp.net, I have created to dropdownlist named country and district and binded the data for each dropdownlist from two different tables called tblcountry and tbldistrict When the county changes in Country dropdownlist, I want the district dropdown to automatically update with a list of districts in that country. can anyone help me.. Thanks in Advance

      H Offline
      H Offline
      Howard Richards
      wrote on last edited by
      #2

      I assume this is a Linq to SQL question - and that you are using SQL datasource? 1) databind both dropdowns to a LINQdataSource 2) the LINQdataSource for Country dropdown is tblCountry 3) the LINQdataSource for District dropdopwn is tblDistrict 4) add a WHERE clause to the District LinqDataSource: WHERE [Country] == [control] - [CountryDropdown] 5) make the country dropdown AutoPostback=true - so when a user changes the country, the District is repopulated. ASP handles the dependencies. Read this [^]for more info.

      'Howard

      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