[英]How to show a confirmation box on CheckboxList selectedIndexChange?
[英]How to display a CheckBoxList on selectedIndexChange action of a DropDownList?
我有一個CheckBoxList ,它在 DropDownList 的selectedIndexChange操作上顯示數據。 一切正常。 我已經在按鈕單擊事件中檢查了它。 但是當我將其與selectedIndexChange一起使用時,什么也沒有發生 。 我沒有任何錯誤或異常。 我也啟用了AutoPostBack屬性。
這是我的代碼
<asp:CheckBoxList ID="chklstKPI" style="width:auto; height:auto; float:right" runat="server" AutoPostBack="True"> </asp:CheckBoxList>
CheckBoxList的代碼
public void loadCheckBoxPanel()
{
DataSet ds = new DataSet();
string cName = ddlCompName.SelectedValue.ToString();
ds = db.fillCheck(cName);
chklstKPI.DataSource = ds.Tables[0];
chklstKPI.DataTextField = "COMPETITION_KPI";
chklstKPI.DataValueField = "COMPETITION_KPI";
chklstKPI.DataBind();
}
我沒有添加查詢。
bool isLoading = true;
private void Form1_Load(object sender, EventArgs e)
{
chklstKPI.Style.Visibility="hidden";
chklstKPI.Style.Displpay="none";
myList.OnSelectedIndexChanged += performCheckBoxAction;
myList.SelectedIndex=0;
isLoading = false;
}
protected void performCheckBoxAction(object sender, EventArgs e){
if(isLoading==false){
isLoading = true;
chklstKPI.Style.visibility="visible";
chklistKPI.Style.display="show";
isLoading=false;
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.