Click here to Skip to main content
15,893,564 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dropdown list that populates on first run with code.
The autopostback is true, but the selectedindexchanged event is not firing.
Can someone please help me?

What I have tried:

<pre><asp:DropDownList ID="dproy" runat="server" Width="180px" AutoPostBack="True" AppendDataBoundItems="true" OnSelectedIndexChanged="dproy_SelectedIndexChanged1" CausesValidation="True" OnTextChanged="dproy_TextChanged" ViewStateMode="Enabled">
                        </asp:DropDownList>


protected void dproy_SelectedIndexChanged1(object sender, EventArgs e)
{
idproy = dproy.SelectedIndex.ToString();
lbl1.Text = idproy;
}
Posted
Updated 23-Jan-18 4:57am
Comments
Richard Deeming 23-Jan-18 13:54pm    
Are you re-binding the list on every page load, without checking the IsPostBack property?

1 solution

Something weird just happened, in the current page the value isn't refreshed, but when I send the value to another page, the selectedindex appears.
Thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900