Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/34.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net 如何调用占位符包含的复选框列表的selectedIndexChange_Asp.net - Fatal编程技术网

Asp.net 如何调用占位符包含的复选框列表的selectedIndexChange

Asp.net 如何调用占位符包含的复选框列表的selectedIndexChange,asp.net,Asp.net,我正在弹出如下的复选框列表。 如何调用占位符包含的复选框列表的SelectedIndexChanged事件 守则: public void loadTracks() { try { ConfigurationDB objConfig = new ConfigurationDB(); DataSet ds = objConfig.GetTracks(Convert.ToInt32( d

我正在弹出如下的复选框列表。 如何调用占位符包含的复选框列表的
SelectedIndexChanged
事件

守则:

public void loadTracks()
{
    try
    {
        ConfigurationDB objConfig = new ConfigurationDB();
        DataSet ds = objConfig.GetTracks(Convert.ToInt32(
                                 ddl.SelectedValue.ToString()));
        CheckBoxList CbxList  = new CheckBoxList();
        // CheckBoxList CbxListtemp = new CheckBoxList();
        CbxList.ID = "Chk";
        for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
        {
            CbxList.Items.Add(new ListItem(ds.Tables[0].Rows[i]["Name"]
                        .ToString(), ds.Tables[0].Rows[i]["ID"].ToString()));
            //CbxListtemp.Items.Add(
               // new ListItem(ds.Tables[0].Rows[i]["Track_Name"].ToString()
               //, ds.Tables[0].Rows[i]["ID"].ToString()));
        }
        // CbxList = CbxListtemp;
        ph.Controls.Add(CbxList);
    }
    catch(Exception ex)
    {
        throw ex
    }
}
public void loadTracks()
{
尝试
{
ConfigurationDB objConfig=新的ConfigurationDB();
数据集ds=objConfig.GetTracks(Convert.ToInt32(
ddl.SelectedValue.ToString());
CheckBoxList CbxList=新的CheckBoxList();
//checkboxlisttemp=新CheckBoxList();
CbxList.ID=“Chk”;
对于(int i=0;i
您需要订阅如下所示的事件处理程序(如果这是您的意思):

public void loadTracks()
{
尝试
{
ConfigurationDB objConfig=新的ConfigurationDB();
DataSet ds=objConfig.GetTracks(Convert.ToInt32(ddl.SelectedValue.ToString());
CheckBoxList CbxList=新的CheckBoxList();
CbxList.SelectedIndexChanged+=新事件处理程序(CbxList\u SelectedIndexChanged);
//checkboxlisttemp=新CheckBoxList();
CbxList.ID=“Chk”;
对于(int i=0;i
        public void loadTracks()
        {
            try
            {
               ConfigurationDB objConfig = new ConfigurationDB();
               DataSet ds = objConfig.GetTracks(Convert.ToInt32(ddl.SelectedValue.ToString()));
               CheckBoxList CbxList  = new CheckBoxList();
                CbxList.SelectedIndexChanged += new EventHandler(CbxList_SelectedIndexChanged);
               // CheckBoxList CbxListtemp = new CheckBoxList();
               CbxList.ID = "Chk";
               for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
               {
                   CbxList.Items.Add(new ListItem(ds.Tables[0].Rows[i]["Name"].ToString(), ds.Tables[0].Rows[i]["ID"].ToString()));
                   //CbxListtemp.Items.Add(new ListItem(ds.Tables[0].Rows[i]["Track_Name"].ToString(), ds.Tables[0].Rows[i]["ID"].ToString()));
               }
               // CbxList = CbxListtemp;
               ph.Controls.Add(CbxList);
            }
            catch(Exception ex)
            {
              throw ex;
            }
        }

        void  CbxList_SelectedIndexChanged(object sender, EventArgs e)
        {
            throw new NotImplementedException();
        }