yokzu

yokzu

  • NA
  • 306
  • 0

dropdownlist problem

Mar 25 2012 8:20 AM
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
-----------------------
 <form id="form1" runat="server">

  <asp:DropDownList ID="DropDownList1" runat="server" Height="19px" Width="121px"
  onselectedindexchanged="DropDownList1_SelectedIndexChanged"  >
  </asp:DropDownList>
</form>
-----------------------

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.


Answers (2)