怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件

时间:2021-04-24 20:55:57
今天学习母版的时候遇到一件很怪的事情,就是不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件,检查了很久发现代码没有错误,于是在一个新的页面里拖放了一个Label控件和一个DropDownList控件,当触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件的时候把值传给Label的text属性来检查是否能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件,但运行后无论如何选择DropDownList控件的值,Label的text都没有变,怪怪怪啊!!!!

代码如下:
Default.aspx
 1 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件<% @ Page Language = " C# "  AutoEventWireup = " true "   CodeFile = " Default.aspx.cs "  Inherits = " _Default "   %>
 2 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件
 3 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 <! DOCTYPE html PUBLIC  " -//W3C//DTD XHTML 1.0 Transitional//EN "   " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
 4 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件
 5 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 < html xmlns = " http://www.w3.org/1999/xhtml "   >
 6 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 < head runat = " server " >
 7 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件     < title > Untitled Page </ title >
 8 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 </ head >
 9 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 < body >
10 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件     < form id = " form1 "  runat = " server " >
11 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件     < div >
12 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件         < asp:Label ID = " Label1 "  runat = " server "  Text = " Label " ></ asp:Label >
13 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件                          < asp:DropDownList ID = " DropDownList1 "  runat = " server "  OnSelectedIndexChanged = " DropDownList1_SelectedIndexChanged " >
14 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件                             < asp:ListItem > 123 </ asp:ListItem >
15 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件                             < asp:ListItem > 456 </ asp:ListItem >
16 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件                             < asp:ListItem > 789 </ asp:ListItem >
17 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件                             < asp:ListItem > abc </ asp:ListItem >
18 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件                         </ asp:DropDownList >
19 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件     </ div >
20 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件     </ form >
21 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 </ body >
22 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 </ html >
23 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件

Default.aspx.cs
 1 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件using  System;
 2 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Data;
 3 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Configuration;
 4 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Web;
 5 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Web.Security;
 6 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Web.UI;
 7 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Web.UI.WebControls;
 8 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Web.UI.WebControls.WebParts;
 9 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 using  System.Web.UI.HtmlControls;
10 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件
11 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 public  partial  class  _Default : System.Web.UI.Page 
12 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件 {
13怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件    protected void Page_Load(object sender, EventArgs e)
14怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件    {
15怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件
16怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件    }

17怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
18怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件    {
19怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件        Label1.Text = DropDownList1.SelectedValue;
20怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件    }

21怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件}

22 怪怪怪问题,不能触发DropDownList1_SelectedIndexChanged(object sender, EventArgs e)事件