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. another dropdownlist question

another dropdownlist question

Scheduled Pinned Locked Moved ASP.NET
databasequestionsql-serversysadmin
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
    krisman
    wrote on last edited by
    #1

    How can you tell I'm a newbie, eh? I have two dropdownlists and two textboxes. Dropdown1 lets you select a city (listr is gathered from a SQL server database) and then fills textbox1. Dropdown2 lets you select a street name for the chosen city (also gathered from a SQl server database), but I can't move the value into textbox2. It seems that on the postback, the selection is cleared from dropdown2. psuedo-code: if not ispostback { get city and move selected value to textbox1 } if ispostback { get street name and move selected value to textbox2 } What am I doing wrong? Krisman

    N 1 Reply Last reply
    0
    • K krisman

      How can you tell I'm a newbie, eh? I have two dropdownlists and two textboxes. Dropdown1 lets you select a city (listr is gathered from a SQL server database) and then fills textbox1. Dropdown2 lets you select a street name for the chosen city (also gathered from a SQl server database), but I can't move the value into textbox2. It seems that on the postback, the selection is cleared from dropdown2. psuedo-code: if not ispostback { get city and move selected value to textbox1 } if ispostback { get street name and move selected value to textbox2 } What am I doing wrong? Krisman

      N Offline
      N Offline
      Not Active
      wrote on last edited by
      #2

      Make sure enable viewstate is true and you are not repopulating the dropdown on postback

      K 1 Reply Last reply
      0
      • N Not Active

        Make sure enable viewstate is true and you are not repopulating the dropdown on postback

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

        I found the answer. I was using IsPostback like everyone suggested and it was always reloading because I was repopulating teh dropdownlist. Anyway the answer is in the onSelectedIndexChanged property. That way you don't have to worry about the IsPostback. Krisman

        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