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 3336624
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:09:28+00:00 2026-05-18T00:09:28+00:00

Bit confused about this. I was under the impression that if you added server

  • 0

Bit confused about this. I was under the impression that if you added server controls to the ItemTemplate of a repeater then the ID’s assigned to those controls would persist across postbacks and the state would be maintained. But it doesn’t seem to be happening. Here’s my ItemTemplate:

<asp:HiddenField ID="hidPending" runat="server" value="<%# DataBinder.Eval(Container.DataItem, "Id")%>" />
<td class="leftpadd"><uc:restrictedtext ID="uclblCategory" runat="server" Width="125" /></td>
<td style="border-left:1px solid #528ABD;" class="leftpadd"><%# DataBinder.Eval(Container.DataItem, "SelectedOptions")%></td>
<td style="border-left:1px solid #528ABD;" class="leftpadd"><%# DataBinder.Eval(Container.DataItem, "Price.IncludingTax", "{0:C}")%></td>
<td style="border-left:1px solid #528ABD;" class="leftpadd"><%# DataBinder.Eval(Container.DataItem, "ExtrasCost", "{0:C}")%></td>
<td style="border-left:1px solid #528ABD;" class="leftpadd"><%# DataBinder.Eval(Container.DataItem, "Quantity", "{0:000}")%></td>
<td style="border-left:1px solid #528ABD;" class="leftpadd"><asp:CheckBox ID="chkPendingItems" runat="server" /></td> 

Which populates fine. What I’m looking to happen is for the user to be able to select certain items from the repeater using the checkbox and “process” them (i.e. perform some data operations on those items) on clicking a button which is outside the repeater. Here’s my button click code:

Private Sub lnkPendingProcessSelected_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkPendingProcessSelected.Click
    For Each rItem As RepeaterItem In rptPendingItems.Items
        If rItem.ItemType = ListItemType.Item Or rItem.ItemType = ListItemType.AlternatingItem Then
            Dim chk As CheckBox = DirectCast(rItem.FindControl("chkPendingItems"), CheckBox)
            If chk.Checked Then
                Dim orderItemId As Integer
                Dim hid As HiddenField = DirectCast(rItem.FindControl("hidPending"), HiddenField)
                orderItemId = CInt(hid.Value)
                My.Application.ManagerFactory.OrderManagerInstance.ChangeOrderItemStatus(orderItemId, Concrete.Cms.DataTransferObjects.OrderItemStatus.Processing)
            End If
        End If
    Next
End Sub

But if you step through this, the checkboxes are found and assigned correctly but their Checked attribute is always False. Anyone have any suggestions as to why state isn’t being maintained and what I can do about it?

  • 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-05-18T00:09:28+00:00Added an answer on May 18, 2026 at 12:09 am

    Based on CyberDude’s comment, you’re probably reseting the values when you databind. If possibly, try using IsPostback to only databind on the first page load.

    C#

    if(!IsPostBack)
    {
        rptPendingItems.DataBind();
    }
    

    VB

    If Not IsPostBack Then
      rptPendingItems.DataBind()
    End If
    

    If that’s not possible, or doesn’t work, you’ll probably have to get and set all of those checkbox values mannually, and persist them against your data set, or in session or summat.

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

Sidebar

Related Questions

I'm a little bit confused about something. I was under the impression that the
I am little bit confused about this statement that I read in a book
I am a bit confused about this. I have an R package that has
I'm a bit confused about this: I thought that if a pointer points to
I am a bit confused about this. If you're building a distributed application, which
I am getting myself a bit confused about how to go about this. My
I'm a bit confused about inheritance under sqlalchemy, to the point where I'm not
I am a bit confused about this function definition in Prolog: sample(X,[X|Tail]) :- member(X,Tail).
I am a bit confused about this piece of code. public static void Foo(A
Can we override hardware back button functionality. I am bit confused about this kindly

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.