drop down list selected index changed event
-
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
-
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