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. DropDownList changed after reading SelectedValue !!!!

DropDownList changed after reading SelectedValue !!!!

Scheduled Pinned Locked Moved ASP.NET
helpdatabasetutorial
4 Posts 3 Posters 1 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.
  • A Offline
    A Offline
    AhmedOsamaMoh
    wrote on last edited by
    #1

    dear sirs i have DropDownList bounded to a datasource , when i read its SelectedValue , the displayed item is changed in the dropdownlist say dropdownlist contains item1 , item2 , item3 , item4 , ...etc whatever i select , the dropdownlist changed to item2 thx dear sir i discovered the problem became more complicated than i thought some more background is needed the dropdownlist is binded to datasoure ( username , password , user rank), i display the username and i return the password in selected value and the dropdownlist sorted by rank indeed the dropdownlist working so fine and the selected item remains even after reading selected value but IN ONLY ONE COND. that such username has a unique password for example: user pass aaa 1234 bbb 1234 ccc 34343 dddd 67657 if i choose ccc it will return 34343 selected index 2 if i choose dddd it will return 67657 selected index 3 if i choose aaa it will return 1234 if aaa is higher rank than bbb if i choose bbb it will return 1234 selected index 1 please kindly help me thx alot bye

    R 1 Reply Last reply
    0
    • A AhmedOsamaMoh

      dear sirs i have DropDownList bounded to a datasource , when i read its SelectedValue , the displayed item is changed in the dropdownlist say dropdownlist contains item1 , item2 , item3 , item4 , ...etc whatever i select , the dropdownlist changed to item2 thx dear sir i discovered the problem became more complicated than i thought some more background is needed the dropdownlist is binded to datasoure ( username , password , user rank), i display the username and i return the password in selected value and the dropdownlist sorted by rank indeed the dropdownlist working so fine and the selected item remains even after reading selected value but IN ONLY ONE COND. that such username has a unique password for example: user pass aaa 1234 bbb 1234 ccc 34343 dddd 67657 if i choose ccc it will return 34343 selected index 2 if i choose dddd it will return 67657 selected index 3 if i choose aaa it will return 1234 if aaa is higher rank than bbb if i choose bbb it will return 1234 selected index 1 please kindly help me thx alot bye

      R Offline
      R Offline
      rakak
      wrote on last edited by
      #2

      set AutoPostBack to false.

      A 1 Reply Last reply
      0
      • R rakak

        set AutoPostBack to false.

        A Offline
        A Offline
        AhmedOsamaMoh
        wrote on last edited by
        #3

        DropDownList.SelectedValue is already false :^)

        C 1 Reply Last reply
        0
        • A AhmedOsamaMoh

          DropDownList.SelectedValue is already false :^)

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

          whether in its Page_Load event has been added like this:

          (! Page.IsPostBack)
          {

          }

          to be this

              protected void Page\_Load(object sender, EventArgs e)
              {
                  if (!Page.IsPostBack)
                  {
                  }
              }
          
          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