Answered by:
Dropdownlist SelectedIndexChanged event not Firing

Question
-
User-712926555 posted
Hi
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" EnableViewState="true" CodeBehind="SPUReceive.aspx.cs" Inherits="POS.Portal.Purchase.SPUReceive" %>
<asp:DropDownList ID="ddlSPUNo" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSPUNo_Change"> </asp:DropDownList>
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Bindings.BindSPUNo(ddlSPUNo); } } protected void ddlSPUNo_Change(object sender, EventArgs e) { }
Page gets Loaded but Dropdownlist SelectedIndexChanged event not Fired
Friday, June 3, 2016 4:46 AM
Answers
-
User-712926555 posted
Hi
I made a mistake binding data
Bindings.BindSPUNo(ddlSPUNo);
ListItem value = "0" for all Item.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, June 3, 2016 5:19 AM
All replies
-
User724169276 posted
From the codes you shared , i feel there is nothing wrong there , can you check if any javascript function is associated with that control which is restricting the postback,morover do check for developer tools console for possible client side defects.
Friday, June 3, 2016 4:54 AM -
User2103319870 posted
By any chance if you dropdownlist is inside of an updatepanel then ensure that you have set the trigger in update panel like below
<asp:UpdatePanel ID="up1" runat="server" UpdateMode="conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="ddlSPUNo" EventName="SelectedIndexChanged" /> </Triggers> <ContentTemplate> <asp:DropDownList ID="ddlSPUNo" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlSPUNo_Change"> </asp:DropDownList> </ContentTemplate> </asp:UpdatePanel>
Friday, June 3, 2016 5:06 AM -
User332523570 posted
Hi,
Your code looks OK. It must work.
How many value are present in drop dowm?
Friday, June 3, 2016 5:17 AM -
User-712926555 posted
Hi
I made a mistake binding data
Bindings.BindSPUNo(ddlSPUNo);
ListItem value = "0" for all Item.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, June 3, 2016 5:19 AM