Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i m using asp.net,C#,VS 2005,sql server 2005..

i have a aspx page...
when Page_Load(object sender, EventArgs e) occurs iam loading dropdownlist with some text values such as study1,study2.... from database...

but when i click on these items SelectedIndexChanged(object sender, EventArgs e) of dropdownlist does not firing...

any help plz...

regards
karan
Posted

1 solution

set autopost back property of dropdown = True

like Below

<asp:DropDownList ID="Dropdown1" runat="server" AutoPostBack="true">
 
Share this answer
 
v3
Comments
karan joshua 12-May-11 3:23am    
thank u sir... It works

one more question:

when i SelectedIndexChanged occurs whatever items there in dropdownlist is added again to DDL..

i.e. if initially 4 items were there on 1 event 8 items will be added then one more event 12 etc

wht s the problem..?

regards
karan
Mahendra.p25 12-May-11 3:27am    
Post your code
karan joshua 12-May-11 3:30am    
<asp:DropDownList ID="StudyIDTextBoxDropDownList" runat="server" Font-Bold="True" AutoPostBack="true"
Font-Size="Large" ForeColor="Black" Height="23px"
Width="198px" OnSelectedIndexChanged="StudyIDTextBoxDropDownList_SelectedIndexChanged" >
<asp:ListItem Value="-1" Selected="True">Select

Mahendra.p25 12-May-11 3:31am    
Code behind code
Mahendra.p25 12-May-11 3:32am    
protected void Page_Load(object sender, EventArgs e)
{

if (!IsPostBack)
{
BindDropdown

}
}

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