Click here to Skip to main content
15,885,952 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to fire dropdownlist selecteditem in aspx.cs page
Posted

This is the basic of Asp.net. Better you could have gone through a book to understand the flow and events of dropdown list. You should read the documentation of DropDownList.
Try this:
HTML:
ASP.NET
<asp:dropdownlist id="DropDownList1" runat="server" xmlns:asp="#unknown">
     onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="true">
</asp:dropdownlist>

C#:
C#
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
    Response.Write(DropDownList1.SelectedItem.Text);
}



All the best.
--Amit
 
Share this answer
 
Comments
John Bhatt 18-Sep-12 0:30am    
*5
_Amy 18-Sep-12 0:51am    
Thanks John. :)
Dear Friend Try This one"

Click on me to get Your Answer
 
Share this answer
 
v3
Comments
mahesh1529 17-Sep-12 7:35am    
My 5!
_Amy 17-Sep-12 7:42am    
Reason for 2 : Wrong search keyword. You could have tried selectedindexchanged event in dropdownlist[^]
sunandandutt 17-Sep-12 7:45am    
Check Now........... Thanks
_Amy 17-Sep-12 7:49am    
Now it's good. :)
sunandandutt 17-Sep-12 7:50am    
where are + Points?
Right Click on Dropdown List,

Choose Properties ,

Click Events in Property Box.

Choose SelectedIndexChanged Event and

Double Click on it. Write Code in C# or VB at backend.
 
Share this answer
 
v2

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