如果有两个dropDownList控件,控件的内容是相同的,但是当选择了第一个dropDownList的其中一列后,选择的这
展开全部
//分公司
protected void ddlArea_SelectedIndexChanged(object sender, EventArgs e)
{
string branchName = this.ddlArea.SelectedItem.Value;
List<OrgEntity> orgList = BLLCreator.Create<OrganizationBLL>().GetOrgEntityList().Where(o => o.ParentOrgCode == branchName).ToList();
ddlBranch.Items.Clear();
ddlBranch.Items.Add(new ListItem(" ", " "));
ddlBranch.Items.FindByValue(" ").Selected = true;
foreach (OrgEntity orgID in orgList)
{
ListItem li = new ListItem();
li.Value = orgID.OrgCode;
li.Text = orgID.OrgName;
ddlBranch.Items.Add(li);
}
}
//网点
protected void ddlBranch_SelectedIndexChanged(object sender, EventArgs e)
{
string branchName=this.ddlBranch.SelectedItem.Value;
List<OrgEntity> orgList = BLLCreator.Create<OrganizationBLL>().GetOrgEntityList().Where(o => o.ParentOrgCode == branchName).ToList();
ddlNetWork .Items.Clear();
ddlNetWork.Items.Add(new ListItem(" ", " "));
ddlNetWork.Items.FindByValue(" ").Selected = true;
foreach (OrgEntity orgID in orgList)
{
ListItem li = new ListItem();
li.Value = orgID.OrgCode;
li.Text = orgID.OrgName;
ddlNetWork.Items.Add(li);
}
}
protected void ddlArea_SelectedIndexChanged(object sender, EventArgs e)
{
string branchName = this.ddlArea.SelectedItem.Value;
List<OrgEntity> orgList = BLLCreator.Create<OrganizationBLL>().GetOrgEntityList().Where(o => o.ParentOrgCode == branchName).ToList();
ddlBranch.Items.Clear();
ddlBranch.Items.Add(new ListItem(" ", " "));
ddlBranch.Items.FindByValue(" ").Selected = true;
foreach (OrgEntity orgID in orgList)
{
ListItem li = new ListItem();
li.Value = orgID.OrgCode;
li.Text = orgID.OrgName;
ddlBranch.Items.Add(li);
}
}
//网点
protected void ddlBranch_SelectedIndexChanged(object sender, EventArgs e)
{
string branchName=this.ddlBranch.SelectedItem.Value;
List<OrgEntity> orgList = BLLCreator.Create<OrganizationBLL>().GetOrgEntityList().Where(o => o.ParentOrgCode == branchName).ToList();
ddlNetWork .Items.Clear();
ddlNetWork.Items.Add(new ListItem(" ", " "));
ddlNetWork.Items.FindByValue(" ").Selected = true;
foreach (OrgEntity orgID in orgList)
{
ListItem li = new ListItem();
li.Value = orgID.OrgCode;
li.Text = orgID.OrgName;
ddlNetWork.Items.Add(li);
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在第一个dropdownlist的选中事件中,获取第一个dropdownlst.SelectedValue,然后移除第二个dropdownlist的Items中找到对应的项ListItem,dropdownlst2.Items.Remove(ListItem),这样第二个就不出现了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在你第一个dropdownlist的 selectindexchange事件中 让 第二个dropdownlist.item.remove(第一个dropdownlist的selectvalue)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你把属性设为0
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询