Click here to Skip to main content
15,888,968 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i write dropdown code like below .
<asp:DropDownList ID="ddlAssignType" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlAssignType_SelectedIndexChanged">


when i change dropdown index , it don't call "ddlAssignType_SelectedIndexChanged" event and then
it always select index 0.
how to solve this proplem
Posted
Comments
db7uk 21-Jun-12 16:06pm    
does a postback occur? What is the code behind?

1 solution

Hello,

You binding should be into Is Not Postback block, code example as below

C#
if(!this.IsPagePostBack)
 {

  // you have to do dropdown binding here
 }


if you do outside the not post back, it's create problem
 
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