62,268
社区成员
发帖
与我相关
我的任务
分享
员工部门:</td> <td class="style5">
<asp:DropDownList ID="DropPart" runat="server" DataSourceID="SqlData"
DataTextField="UserPart" DataValueField="PartNO" AutoPostBack="True"
onselectedindexchanged="DropPart_SelectedIndexChanged">
</asp:DropDownList>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string id1 = Request["ID"];// 接收传值 判断修改的标准.
string id2 = Request["id2"];//接收传值,判断编辑还是添加.
string sql = "select * from AllUserInfor where ID=" + id1 + "";
DropPart.Text = GetDataTable(sql).Rows[0]["UserPart"].ToString();//为何在此处获取不到数值。
string AA = GetDataTable(sql).Rows[0]["UserPart"].ToString();//此处可以获得数据为"开发部门"
DropPart.Text = AA;//将AA的数据赋给DropDownList 的Text 为何还是为空
}