Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9048477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:09:58+00:00 2026-06-16T12:09:58+00:00

I have a repeater control and each item/row has an asp:Checkbox control and a

  • 0

I have a repeater control and each item/row has an asp:Checkbox control and a button next to it.

My problem is that if I check a given checkbox and click on the button next to it [before postback], the state (checked)
of the previously checked Checkbox is preserved [after postback]. But I don’t want it to be preserved so I’ve done the following for all the Checkboxes:

  1. Disabled the viewstate (EnableViewState=’false’) of the Checkboxes (and repeater)
  2. Defined the property Checked=”false”
<td>
<asp:CheckBox ID="chk_chooseTOL" CssClass="chk_chooseTOL" runat="server" Checked="false" EnableViewState="false" />
</td>

I looked at the state of the checkbox from the code-behind during the ItemDataBound event of the repeater in debugging mode, and it’s fine, none of the checkboxes is checked, but at the end, the page is displayed and the previously checked checkbox remains checked. I don’t understand why.

Do you have any idea how to not preserved the state of my checkboxes? (I need the check boxes to be server-side controls in order to disable them during the ItemDataBound event on a particular condition)

Thank you

Some more code :

<asp:Repeater ID="rpt_CA" runat="server" DataSourceID="TLDataSource" EnableViewState="false" OnItemDataBound="rpt_CA_OnItemDataBound" ClientIDMode="Static" >
    <HeaderTemplate>
        <table class="ca_table persist-area" id="rpt_CA">
            <thead>
            <tr class="tl-header persist-header">
                <th>Consultant</th>
                <th>Mode</th> 
                <th></th> 
            </tr>
            </thead>
            <tbody>
    </HeaderTemplate>
    <ItemTemplate>
    <tr>
        <td>
        <asp:Label runat="server" Text='<%# Eval("EMPLOYEES.FULLNAME") + " (" + Eval("ID_EMPLOYEE") + ")"  %>' />
        </td>
        <td>
        <asp:Button runat="server" Text="Gen" EnableViewState="false" />
        </td>
        <td>
        <asp:CheckBox ID="chk_chooseTOL" CssClass="chk_chooseTOL" runat="server" Checked="false" EnableViewState="false" />
        </td>
    </tr>
    </ItemTemplate>
    <FooterTemplate>
        </tbody>
        </table>
    </FooterTemplate>
</asp:Repeater>

.

protected void rpt_CA_OnItemDataBound(object Sender, RepeaterItemEventArgs Args) {
    if (Args.Item.ItemType == ListItemType.Item || Args.Item.ItemType == ListItemType.AlternatingItem)
    {   TURNOVER_LINES currentTL = (TURNOVER_LINES)Args.Item.DataItem;  RepeaterItem ri = Args.Item;

             CheckBox chk_chooseTOL = Args.Item.FindControl("chk_chooseTOL") as CheckBox;
             if(currentTL.IS_ALREADY_GEN)
             {
                 chk_chooseTOL.Enabled = false;
             }

    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T12:09:59+00:00Added an answer on June 16, 2026 at 12:09 pm

    It’s not enough to put Checked=”false” to lose the state. This value will be overwritten with the checked state in the form. To prevent that, you need to set checked=false from the code-behind, in the page_load event, or after it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a repeater, and each item has a check box and radio button.
Greetings! I have a Repeater control that's using an XmlDataSource control. <asp:FormView id=myFormView runat=server
I have a repeater control that repeats a DevExpress ASPxGridView for every item bound
I am creating a simple ASP page that has a Repeater control. This repeater
I have a repeater control that houses several RadioButtonLists with various RadioButtons in each
I have an ASP.NET Repeater control with a FileUpload Control in its item template.
I am using a repeater control that shows data for some table. Each row
I'm implementing a comment control that uses an ASP.Repeater to display each comment. The
I have Repeater Control and in that i have code like this <div runat=server
I have Repeater Control as shown below. <asp:Repeater ID=rptCategory runat=server> <HeaderTemplate> <h2 class=art-logo-text style=margin-bottom:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.