0

チェックボックスフィールドを含むリストを表示するリピーターを使用します。チェックボックスをクリックすると、関数を実行してラベルを表示したい....これをデバッグしようとしていますが、ブレークポイントを使用しても機能しないようです。

//コードビハインド

 protected void chkMyCheck_CheckedChanged(object sender, EventArgs e)
    {
        label.Text = "Button Clicked";
    }

aspx:

<asp:Repeater id="rptSelectedUtilities" runat="server">
            <HeaderTemplate>
                <table class="detailstable FadeOutOnEdit">
                    <tr>   
                        <th style="width:200px;">Utility</th>    
                        <th style="width:200px;">Contacted</th>   
                        <th style="width:200px;">Comment</th>    
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                    <tr>
                        <th style="width:200px;"><%# Eval("Name") %></th>
                        <th style="width:200px;"><asp:CheckBox ID="chkMyCheck" AutoPostBack="true" runat="server" OnCheckedChanged="chkMyCheck_CheckedChanged" Checked='<%# Convert.ToBoolean(Eval("Checked")) %>'/></th>   
                        <th style="width:200px;"><%# Eval("Comment") %></th>  
                    </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>

        <asp:Label id="labelTableEmpty" runat="server" Text="There are currently no items in this table." />

        <asp:Label ID ="label" runat="server" />

チェックボックスがクリックされたときにコードが chkMyCheck_CheckedChanged 関数に入らない理由について何か考えはありますか?

4

1 に答える 1

1

!IsPostBack 内でリピーターをバインドしていますか ????

為に

void page_load()
{

if(!IsPostBack)
{
//BindRepeater method??? 
}
}

小切手

于 2013-03-08T14:43:15.447 に答える