在绑定一个dropdownList控件时如下:
string sql = "select roof_id,roof_name from db_config..a8_stat_roof";
DataTable dt = SqlHelper.ExeTable(sql);
DropDownList1.DataSource = dt;
DropDownList1.DataTextField = "roof_name";
DropDownList1.DataValueField = "roof_id";
DropDownList1.DataBind();
如果是这样,则可以在客户端执行webForm._DoCallBack,并且可以有返回值。
如果DropDownList1.DataValueField = "roof_id";注释掉,那么有执行webForm._DoCallBack,但服务器端没有执行,
如果DropDownList1.DataTextField = "roof_name";
DropDownList1.DataValueField = "roof_id";这两句都注释掉,也可以有返回。
真是奇怪。