
为什么运行后会出现““/WebSite3”应用程序中的服务器错误。
--------------------------------------------------------------------------------
回发或回调参数无效。在配置中使用
this.DropDownList.Items.RemoveAt(this.DropDownList.SelectedIndex);
出现你说的那个问题的原因是你加前粗载数据的时候没有判断是否是回发数据
在页面的Page_Load事件中添模悔数加判断,如下:
if (!IsPostBack)
{
//加载数据
}
注意旦首:IsPostBack前面有个取反!
this.DropDownList1.Items.Remove(this.DropDownList1.SelectedItem);
或
this.DropDownList1.Items.RemoveAt(this.DropDownList1.SelectedIndex);
在此页面的第一行中加入:
EnableEventValidation="false"