Click here to Skip to main content
14,493,689 members
Rate this:
Please Sign up or sign in to vote.
See more:
how to fire dropdownlist selecteditem in aspx.cs page
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 3

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.
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 2

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:dropdownlist id="DropDownList1" runat="server" xmlns:asp="#unknown">
     onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="true">
</asp:dropdownlist>

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



All the best.
--Amit
   
Comments
John Bhatt 18-Sep-12 0:30am
   
*5
_Amy 18-Sep-12 0:51am
   
Thanks John. :)
Rate this:
Please Sign up or sign in to vote.

Solution 1

Dear Friend Try This one"

Click on me to get Your 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?
_Amy 17-Sep-12 7:55am
   
Oho.. I forgot. +5! :)
sunandandutt 17-Sep-12 8:00am
   
Thaks _Amy

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100