asp.net中的更新面板 [英] update panel in asp.net
本文介绍了asp.net中的更新面板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在母版页中有更新面板,其中包含两个下拉列表状态和城市,我在内容页面中有更新面板,其中包含datalist控件...如何根据下拉列表中的选定值绑定datalist
i have update panel in master page which contains two dropdown list states and city and i have update panel in content page which contains datalist control...how can i bind datalist according to selected value in dropdown lists
推荐答案
您可以使用此方法从母版页中找到下拉列表值。
you can find dropdownlist value from master page by using this method.
string StateValue;
DropDownList masterState = (DropDownList)Master.FindControl("ddlState");
DropDownList masterCity = (DropDownList)Master.FindControl("ddlCity");
StateValue = masterState.SelectedValue;
这很简单。在内容页面中,您可以在母版页中搜索控件,如果找到控件,您可以执行以下操作:
It is pretty simple. From the content page, you can search for the controls in the master page and if the control is found, you can do something like this:
DropDownList stateInMaster = null;
if(Master.FindControl("ddlState") != null)
stateInMaster = (DropDownList)Master.FindControl("ddlState");
staring selectedStateValue = stateInMaster.SelectedValue;
这篇关于asp.net中的更新面板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文