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 problem

dropdownlist problem

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

    i have used the dropdownlist with data from database Whenever i run my application it always shows the first item of the dropdownlist as my selected item.How can avoid this Plz hel me?

    B C 2 Replies Last reply
    0
    • I indian22

      i have used the dropdownlist with data from database Whenever i run my application it always shows the first item of the dropdownlist as my selected item.How can avoid this Plz hel me?

      B Offline
      B Offline
      Blue_Boy
      wrote on last edited by
      #2

      Bind DropDownlist inside !Page.IsPostBack if(!PageIsPostBack) { //bind here dropdownlist }


      I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com

      1 Reply Last reply
      0
      • I indian22

        i have used the dropdownlist with data from database Whenever i run my application it always shows the first item of the dropdownlist as my selected item.How can avoid this Plz hel me?

        C Offline
        C Offline
        Christian Graus
        wrote on last edited by
        #3

        your question makes absolutely no sense. 'every time you run the application' ? If you mean every time you do a postback, then the other answer you got is correct. If you mean what you said, what did you expect it to show ? If you want to show something else, then you need to set the selected index. Perhaps if you explain yourself better.

        Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.

        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