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. weird situation with autopostback

weird situation with autopostback

Scheduled Pinned Locked Moved ASP.NET
debuggingdatabasehelp
4 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.
  • R Offline
    R Offline
    RoyRose78
    wrote on last edited by
    #1

    Hey all, I have a DropDownList control in my page. I set the AutoPostBack property to true and also created the SelectedIndexChanged event method. Everytime I change the index it supposes to call the SelectedIndexChanged event but it only call it when index is not zero :mad: With the use of debugger and breakpoint at this method I realized that when the dropDownList's SelectedIndex is not zero - the event is raized but when the index is zero it ignores the event Please help :sigh: RoyRose

    R 1 Reply Last reply
    0
    • R RoyRose78

      Hey all, I have a DropDownList control in my page. I set the AutoPostBack property to true and also created the SelectedIndexChanged event method. Everytime I change the index it supposes to call the SelectedIndexChanged event but it only call it when index is not zero :mad: With the use of debugger and breakpoint at this method I realized that when the dropDownList's SelectedIndex is not zero - the event is raized but when the index is zero it ignores the event Please help :sigh: RoyRose

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

      I have another comment.. The problem was with index 0 I realizes that when I set the item in index 1 to selected = true the event not fired to it! <asp:DropDownList ID="_TableDropDownList" ... OnSelectedIndexChanged="_TableDropDownList_SelectedIndexChanged"> <asp:ListItem>cities</asp:ListItem> <asp:ListItem Selected="**True**">courses</asp:ListItem> </asp:DropDownList> I set all items with Selected="False" but still when I choose the item in index zero it won't fire the event..

      M 1 Reply Last reply
      0
      • R RoyRose78

        I have another comment.. The problem was with index 0 I realizes that when I set the item in index 1 to selected = true the event not fired to it! <asp:DropDownList ID="_TableDropDownList" ... OnSelectedIndexChanged="_TableDropDownList_SelectedIndexChanged"> <asp:ListItem>cities</asp:ListItem> <asp:ListItem Selected="**True**">courses</asp:ListItem> </asp:DropDownList> I set all items with Selected="False" but still when I choose the item in index zero it won't fire the event..

        M Offline
        M Offline
        MD12
        wrote on last edited by
        #3

        Youn can find one solution for that you can add some other listitem in place of listitem at 0 index as select or please select one or select one, or 0th index item you keep it nothing like cities

        R 1 Reply Last reply
        0
        • M MD12

          Youn can find one solution for that you can add some other listitem in place of listitem at 0 index as select or please select one or select one, or 0th index item you keep it nothing like cities

          R Offline
          R Offline
          RoyRose78
          wrote on last edited by
          #4

          I'm king of lost here... this situation is very weird because the event is not fired when I select the first item in my drop down list..! Let me tell you the exact problem: I have a user control with a drop down list control. This control is auto post back to server when index is changed. When I select the second(or third, forth etc) item - the event method _TableDropDownList_SelectedIndexChanged is being called. When I select the first item this event isn't fired - so _TableDropDownList_SelectedIndexChanged is not being called! I use breakpoints in this event method and also in page_load method and I can say that page_load is happend but _TableDropDownList_SelectedIndexChanged isn't. it just ignores it somehow when I select the first item... Someone please :(( RoyRose

          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