我添加了一个DropDownList,在其SelectedIndexChanged中写了如下代码,但没有反映,请高手指导private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
{
   Label1.Text="您选择的学校是:"+DropDownList1.SelectedItem.Text;
}

解决方案 »

  1.   

    <asp:DropDownList id="DropDownList1" style="Z-INDEX: 101; LEFT: 256px; POSITION: absolute; TOP: 96px"
    runat="server" AutoPostBack="True"></asp:DropDownList>
    记得
    AutoPostBack="True"还要记得在 page_load中加入if not ispostback  then
    end if
      

  2.   

    加到Page_Load中
    DropDownList1.AutoPostBack = true ;
    试试
      

  3.   

    在设计页面,"属性"中设置AutoPostBack为true
      

  4.   

    DropDownList1.AutoPostBack="True";private void Page_Load(object sender, System.EventArgs e)
    {
          if(!IsPostBack)
          {
             //该页面初始化的代码
          }
          //可以加你在响应事件和初始化时一同实现的代码}private void DropDownList1_SelectedIndexChanged(object sender, System.EventArgs e)
    {
       Label1.Text="您选择的学校是:"+DropDownList1.SelectedItem.Text;
    }
      

  5.   

    设置 DropDownList1.AutoPostBack=True;
      

  6.   

    设置dropdownlist1的属性autopostback=true!!!
      

  7.   

    设置 DropDownList1.AutoPostBack="True";
    还要注意页面回发
      

  8.   

    <asp:DropDownList id="DropDownList1" runat="server" AutoPostBack="True"></asp:DropDownList>
      

  9.   

    自动回拨为真:
    AutoPostBack="True"
      

  10.   

    DropDownList1的AutoPostBack属性设为True
      

  11.   

    你得确信你的事件没有丢失,其次上面说的autopostback得=true--觉得你应该加了,还有你其他的位置有没有对其进行修改?还是单步调试下吧看下执行流程!
      

  12.   

    如果AutoPostBack已设为true,再重新注册下事件