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

  • Home
  • SEARCH
  • 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 1021045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:15:06+00:00 2026-05-16T11:15:06+00:00

I need to do some server side logic on a row in my repeater

  • 0

I need to do some server side logic on a row in my repeater when a CheckBox is clicked inside the repeater control.

Anyone know how to go about this?

The way I see it you cant fire item command and if you use the CheckBoxes OnClick you cant get the repeater row.

  • 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-16T11:15:07+00:00Added an answer on May 16, 2026 at 11:15 am

    Here is a quick mock-up of how I have done similar in the past.

        <asp:Repeater id="repeater1" runat="server" OnItemDataBound="repeater1_OnItemDataBound" >
            <ItemTemplate>
                <asp:CheckBox ID="chk" runat="server" OnCheckedChanged="Check_Changed" AutoPostBack="true" />
            </ItemTemplate>
        </asp:Repeater>
    

    codebehind:

        public class Model {
            public int Id { get; set; }
            public string Name { get; set; }
        }
    
        public partial class Checkboxes : System.Web.UI.Page {
            protected void Page_Load(object sender, EventArgs e) {
                if(!IsPostBack ) {
                    repeater1.DataSource = new List<Model> { 
                                   new Model { Id = 1, Name = "a" }, 
                                   new Model { Id = 2, Name = "b" }, 
                                   new Model { Id = 3, Name = "c" } };
                    repeater1.DataBind();
                }
            }
    
            protected void repeater1_OnItemDataBound(Object sender, RepeaterItemEventArgs e) {
                if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) {
                    var item = e.Item.DataItem as Model;
                    if (item != null) {
                        var chk = e.Item.FindControl("chk") as CheckBox;
                        if (chk != null) {
                            chk.Text = item.Name;
                            chk.InputAttributes.Add("value", item.Id.ToString());
                        }
                    }
                }
            }
    
            protected void Check_Changed(Object sender, EventArgs e) {
                var id = ((CheckBox) sender).InputAttributes["value"];
                //you now have access to the item id and can manipulate at will.
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a shell script to do some web server configuration. I need to
I need to copy some records from our SQLServer 2005 test server to our
I need to pull some BLOB data from a SQL Server 2005 database and
Our DB server fell, and we need to restore some of it's DB's. We
I have some reports in SQL Server Reporting Services 2005 that I need to
So our web server apps need to connect to the database, and some other
I have some settings I need in a Javascript file -- servers to connect
I need some advice as to how I easily can separate test runs for
I need some info on how to use margins and how exactly padding works.
I need some software to explore and modify some SQLite databases. Does anything similar

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.