Hi,
I just want to run a function when an item selected on dropdownlist. But it doesnt work. My codes below;
in default.aspx page
-----------------------
-----------------------
in default.aspx.cs file
-----------------------
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
Label1.Text = "Test";
}
----------------------
I just want to write a test mesaage to lable1 but it isnt work. I mean "DropDownList1_SelectedIndexChanged" function doesnt run when I change the dropdownlist's item.
How can I run a function when I change the dropdownlist's item?
Regards.
Loading
SenthilkumarPosted Mar 25, 2012, 9:05 AM
I did not find any code issue in your code. But when you use the DropDownList or TextBox, the AutoPostBack property has to be set as true. By default it is false.
onselectedindexchanged="DropDownList1_SelectedIndexChanged" AutoPostBack="true" >
Please try and let me know.
yokzuPosted Mar 25, 2012, 9:12 AM