private void loadDropLis() { DropDListBigType.DataTextField = "ProductBigTypeName"; DropDListBigType.DataValueField = "ProductBigTypeId"; DropDListBigType.DataSource = typebll.GetAllList(); DropDListBigType.DataBind(); DropDListSmalType.DataTextField = "ProductsTypeName"; DropDListSmalType.DataValueField = "ProductsTypeId"; DropDListSmalType.DataSource = typebll.GetSmallType(Convert.ToInt32(DropDListBigType.SelectedValue)).Tables[0]; DropDListSmalType.DataBind(); } 程序: loadDropLis();调用绑定方法 DropDListBigType.SelectedValue = typebll.GetBigType(model.ProductsTypeId).Tables[0].Rows[0]["ProductBigTypeName"].ToString();报错但是string a=typebll.GetBigType(model.ProductsTypeId).Tables[0].Rows[0]["ProductBigTypeName"].ToString();可以取到值。前面我也绑定了?我想先把所有项加载出来。然后默认选中数据库中邪的项。希望指出原因。
添加回答
举报
0/150
提交
取消