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. Remove duplicate value from dropdownlist

Remove duplicate value from dropdownlist

Scheduled Pinned Locked Moved ASP.NET
3 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.
  • K Offline
    K Offline
    kishorgh
    wrote on last edited by
    #1

    There is dropdownlist on my page which showes country name. on click of country name popup will get display which showes companyname of selected country , and same dropdown will again get display. In Popup dropdownlist ,it will display selectedItem value (CountryName)as which we have selected from main page. for tht i have return code as follwes drdCountry.DataTextField = "CountryName"; drdCountry.DataValueField = "CompanyCount"; drdCountry.DataSource = dsCoverageList.Tables[0].DefaultView; drdCountry.DataBind(); drdCountry.SelectedItem.Text = Request.QueryString["CountryName"].ToString(); drdCountry.SelectedItem.Value = Request.QueryString["CompCount"].ToString(); but prob is on popup page in dropdownlist is showes duplicate value of selected item means suppose i have selected US (CountryName) from main drplist thn in popup page is showes US 2 times in DrpList. why is it so??.. :( please help me out..

    M 1 Reply Last reply
    0
    • K kishorgh

      There is dropdownlist on my page which showes country name. on click of country name popup will get display which showes companyname of selected country , and same dropdown will again get display. In Popup dropdownlist ,it will display selectedItem value (CountryName)as which we have selected from main page. for tht i have return code as follwes drdCountry.DataTextField = "CountryName"; drdCountry.DataValueField = "CompanyCount"; drdCountry.DataSource = dsCoverageList.Tables[0].DefaultView; drdCountry.DataBind(); drdCountry.SelectedItem.Text = Request.QueryString["CountryName"].ToString(); drdCountry.SelectedItem.Value = Request.QueryString["CompCount"].ToString(); but prob is on popup page in dropdownlist is showes duplicate value of selected item means suppose i have selected US (CountryName) from main drplist thn in popup page is showes US 2 times in DrpList. why is it so??.. :( please help me out..

      M Offline
      M Offline
      mr_muskurahat
      wrote on last edited by
      #2

      use page.ispostback check on page load or clear dropdown list before filling it...

      Government Dyal Singh College Lahore.

      K 1 Reply Last reply
      0
      • M mr_muskurahat

        use page.ispostback check on page load or clear dropdown list before filling it...

        Government Dyal Singh College Lahore.

        K Offline
        K Offline
        kishorgh
        wrote on last edited by
        #3

        i have writ code in (!IsPostBack) still its not working..:(

        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