两个下拉框数据互连为什么回发后才显示数据
页面回发后rdoTypeShow()才接收到数据!protectedvoidPage_Load(objectsender,EventArgse){if(!Page.IsP...
页面回发后rdoTypeShow()才接收到数据!
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TitltShow();
lblwxzt.Text = ddlistTitle.SelectedValue.ToString();
rdoTypeShow(ddlistTitle.SelectedValue.ToString());
}
}
public void rdoTypeShow(string type)
{
IList<TitleType> list = TitleTypeManager.GetNodeIdByTitleType(type);
ddlistType.Items.Clear();
ddlistType.Items.Add(new ListItem("==请选择==", "0"));
foreach (TitleType tt in list)
{
ListItem li = new ListItem();
li.Value = tt.ClassId.ToString();
li.Text = tt.Title;
ddlistType.Items.Add(li);
}
}
public void TitltShow()
{
IList<TitleType> list = TitleTypeManager.GetNodeInfoByTitleType();
ddlistTitle.Items.Clear();
ddlistTitle.Items.Add(new ListItem("==请选择==", "w"));
foreach (TitleType tt in list)
{
ListItem li = new ListItem();
li.Value = tt.ClassId.ToString();
li.Text = tt.Title;
ddlistTitle.Items.Add(li);
}
}
protected void ddlistTitle_SelectedIndexChanged(object sender, EventArgs e)
{
rdoTypeShow(ddlistTitle.SelectedValue.ToString());
} 展开
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
TitltShow();
lblwxzt.Text = ddlistTitle.SelectedValue.ToString();
rdoTypeShow(ddlistTitle.SelectedValue.ToString());
}
}
public void rdoTypeShow(string type)
{
IList<TitleType> list = TitleTypeManager.GetNodeIdByTitleType(type);
ddlistType.Items.Clear();
ddlistType.Items.Add(new ListItem("==请选择==", "0"));
foreach (TitleType tt in list)
{
ListItem li = new ListItem();
li.Value = tt.ClassId.ToString();
li.Text = tt.Title;
ddlistType.Items.Add(li);
}
}
public void TitltShow()
{
IList<TitleType> list = TitleTypeManager.GetNodeInfoByTitleType();
ddlistTitle.Items.Clear();
ddlistTitle.Items.Add(new ListItem("==请选择==", "w"));
foreach (TitleType tt in list)
{
ListItem li = new ListItem();
li.Value = tt.ClassId.ToString();
li.Text = tt.Title;
ddlistTitle.Items.Add(li);
}
}
protected void ddlistTitle_SelectedIndexChanged(object sender, EventArgs e)
{
rdoTypeShow(ddlistTitle.SelectedValue.ToString());
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询