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. General Programming
  3. C#
  4. drop down list selected index changed event

drop down list selected index changed event

Scheduled Pinned Locked Moved C#
databasesysadminhelpquestion
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.
  • C Offline
    C Offline
    chithra r
    wrote on last edited by
    #1

    hi all can anyone help me in this regard..in my application iam using a drop down list and in the selected index changed event of that iam writing some code to make the controls visible false.this works fine when the page is loaded for the first time.when i select any value from the drop down next time this event is not executed.is the selected index changed event works only for the first time when the page loads?? here is the code.. ASPX page <asp:Panel ID="pnlRegions" runat="server" Height="29px" Width="500px"> <asp:Label ID="lblregion" CssClass="lbl" Font-Bold="true" runat="server" Text="Region"></asp:Label>    <asp:DropDownList ID="ddlRegion" runat="server" Width="165px" OnSelectedIndexChanged="ddlRegion_SelectedIndexChanged"/>    <asp:Button ID="btnFind" runat="server" Text="Find Restaurant" OnClick="btnFind_Click"/> <br /><br /> </asp:Panel> <asp:Panel ID="pnlDisplay" runat="server" > <asp:Label id="lblTotalRest" runat="server" CssClass="NormalText" Text="Total Records" Width="186px" ></asp:Label>     <asp:Button id="btnDisplay" runat="server" CssClass="button" Text="Display" OnClick="btnDisplay_Click"></asp:Button> </asp:Panel> CODE BEHIND protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e) { ClearClassData(); pnlDisplay.Visible = false; } protected void btnFind_Click(object sender, EventArgs e) { grdDescList.Visible = true; pnlDisplay.Visible = true; GetRestaurant("REGION"); ClearClassData(); } the event get executed only after the find button click when i checked by putting breakpoints.. any help will be appreciated.

    pintoo

    R 1 Reply Last reply
    0
    • C chithra r

      hi all can anyone help me in this regard..in my application iam using a drop down list and in the selected index changed event of that iam writing some code to make the controls visible false.this works fine when the page is loaded for the first time.when i select any value from the drop down next time this event is not executed.is the selected index changed event works only for the first time when the page loads?? here is the code.. ASPX page <asp:Panel ID="pnlRegions" runat="server" Height="29px" Width="500px"> <asp:Label ID="lblregion" CssClass="lbl" Font-Bold="true" runat="server" Text="Region"></asp:Label>    <asp:DropDownList ID="ddlRegion" runat="server" Width="165px" OnSelectedIndexChanged="ddlRegion_SelectedIndexChanged"/>    <asp:Button ID="btnFind" runat="server" Text="Find Restaurant" OnClick="btnFind_Click"/> <br /><br /> </asp:Panel> <asp:Panel ID="pnlDisplay" runat="server" > <asp:Label id="lblTotalRest" runat="server" CssClass="NormalText" Text="Total Records" Width="186px" ></asp:Label>     <asp:Button id="btnDisplay" runat="server" CssClass="button" Text="Display" OnClick="btnDisplay_Click"></asp:Button> </asp:Panel> CODE BEHIND protected void ddlRegion_SelectedIndexChanged(object sender, EventArgs e) { ClearClassData(); pnlDisplay.Visible = false; } protected void btnFind_Click(object sender, EventArgs e) { grdDescList.Visible = true; pnlDisplay.Visible = true; GetRestaurant("REGION"); ClearClassData(); } the event get executed only after the find button click when i checked by putting breakpoints.. any help will be appreciated.

      pintoo

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

      has autopost back property of this control is set true or not.

      rahul

      C 1 Reply Last reply
      0
      • R rah_sin

        has autopost back property of this control is set true or not.

        rahul

        C Offline
        C Offline
        chithra r
        wrote on last edited by
        #3

        yes rahul it was not set to true.. thanks for the valuable suggestion. now it is working fine..

        pintoo

        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