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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:07:17+00:00 2026-05-11T10:07:17+00:00

In my .NET application I need to add a checkbox to each row in

  • 0

In my .NET application I need to add a checkbox to each row in a dynamically created asp:Table. Is it possible to do that by dynamically creating an asp:CheckBox for each row and somehow put it inside a TableCell object? (In that case how?)

Or do I need to replace the asp:table control with something else, like a Repeater control or GridView to make it work?

I’m looking for the quickest solution because I don’t have much time.

Thanks in advance!

/Ylva

  • 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. 2026-05-11T10:07:18+00:00Added an answer on May 11, 2026 at 10:07 am

    You do not want to do it on server side( in the cs as Yossarian said). because every time your page is reloaded or refreshed, you would have to recreate those checkboxes, which would mean new checkboxes every load, which also would mean your checkbox controls info will be lost because they are not on the client side, so all updated info done by the user (checkbox checked)will be lost, so you want be able to find out what is checked unless you add jquery in and it starts to get more complicated then it needs to be

    if you are using webpages then it would be best to use asp:Gridview web control and bind the data to the table in code behind as so:

      Gridview.Datasource=//ex:data;     Gridview.Databind(); 

    As shown in the example on this page here

    but if you are using MVC then you would add them in the client code in a form as so:

          <% using (Html.BeginForm('Presentation', 'Home')) %>         <% { %>   <table id='Table' class='color' width='100%' border='1'>  <colgroup width='3%' ></colgroup> <colgroup width='15%'></colgroup> <colgroup width='20%'></colgroup> <colgroup width='15%'></colgroup> <colgroup width='47%'></colgroup> <thead>     <tr class='dxgvHeader_Glass'>           <th id='CheckBox' class='style1' ><input type='checkbox' class='selectall' id='selectall' name='CheckBox' /></th>           <th id='DateTime'  runat='server'></th>            <th id='Description' runat='server'></th>     </tr> </thead>  <tbody > <%try   { %>    <% foreach (var SamAuditLog in ViewData.Model)       { %>         <tr>              <td class='style1' align='center'><%=Html.CheckBox(''+data.ID) %></td>                <td><%= data.DateTime%></td>              <td><%= data.Description%></td>         </tr>     <% } %>         <%} %>  </tbody> 

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

Sidebar

Related Questions

i need to add some functionality to an asp.net application that allows the positioning
I am creating an ASP.NET application that allows the user to add form elements
I created an asp.net application that fills a table with information from a database,
I've created this ASP.Net application and need to record what the users have done
We have an ASP.NET application and I need to add a custom HTTP header
I have an asp.net mvc application and now I need to add a web
i have created a vc++ console application i need to add .net assembly references.
I have asp.net mvc 3 application and I need to add some html to
I'm creating an asp.net application and I need to get the name of the
I need to add some metrics and statistics capabilities in ASP.NET application (Framework 2.0,

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.