Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/335.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
C# 复选框checkedchanged未触发listview中的_C#_Asp.net_Listview_Checkbox - Fatal编程技术网

C# 复选框checkedchanged未触发listview中的

C# 复选框checkedchanged未触发listview中的,c#,asp.net,listview,checkbox,C#,Asp.net,Listview,Checkbox,这是我的Listview布局模板。我把CheckBox放在它的旁边,当我选中CheckBox时,我想把它放在页面的后面。但这里的问题是,我不能在checkedChanged事件中激活复选框。甚至在我的属性窗口中也没有任何复选框事件。所以,如果有人对这个问题有任何想法,那么请帮助我 <LayoutTemplate> <table id="example1" class="table table-bordered table-striped"> &l

这是我的Listview布局模板。我把
CheckBox
放在它的旁边,当我选中CheckBox时,我想把它放在页面的后面。但这里的问题是,我不能在checkedChanged事件中激活复选框。甚至在我的属性窗口中也没有任何复选框事件。所以,如果有人对这个问题有任何想法,那么请帮助我

<LayoutTemplate>
     <table id="example1" class="table table-bordered table-striped">
        <thead>
           <tr>
              <td>
                  <asp:CheckBox ID="chkCheck" runat="server" CommandName="ChkChange" AutoPostBack="True"></asp:CheckBox>
             </td>
          </tr>
        </thead>
      </table>
</LayoutTemplate>

您没有定义要调用的方法,因此复选框不知道要使用什么方法

    <asp:CheckBox ID="chkCheck" OnCheckedChanged="Check_Clicked"
    runat="server" CommandName="ChkChange" AutoPostBack="True"></asp:CheckBox>

您能将整个列表视图控件与事件和代码一起粘贴吗?我知道我的代码中没有定义任何OnCheckedChanged=“Check_Clicked”,但问题是我在属性窗口中没有得到任何事件列表。我不太明白问题是什么。你没有活动清单是什么意思?如果您打开属性窗口,但没有定义任何内容,则应该有一个标签为“OnCheckedChanged”的空框。CommandName等也存在。把“Check_Clicked”放在那里,或者直接在代码中定义它。这没什么区别。实际上我从来没有使用过属性窗口。
void Check_Clicked(Object sender, EventArgs e)   
{  
  //do something
}