473,387 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ASP.NET Selecting CheckBox Value

i want a selected check box value from datalist check box code..

my code is follwing....
Expand|Select|Wrap|Line Numbers
  1. <asp:DataList RepeatDirection="Horizontal" RepeatColumns="2" id="dtlListChoiceSelection" runat="server" Width="500px"> 
  2.             <ItemTemplate> 
  3.              <asp:Image Width="100px" Height="50px" id="imgSmallChoice" runat="server" AlternateText='<%# DataBinder.Eval(Container.DataItem, "ChoiceName")%>' 
  4.                 ImageURL='<%# DataBinder.Eval(Container.DataItem, "SmallImage")%>' /><br/>  
  5.  
  6.              <asp:CheckBox ID="CardChoice" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ChoiceCode")%>' />
  7.             </ItemTemplate>
  8.          </asp:DataList>
  9.  
  10.          <asp:Button ID="btn" runat="server" Text="click" OnClick="btn_Click"  /> 
  11.  
  12.  private void selectedcheckbox()
  13.     {
  14.        // foreach (DataGridItem DGI in SalesDataGrid.Items)
  15.         //{
  16.         foreach (DataListItem DGI in dtlListChoiceSelection.Items)
  17.         {
  18.  
  19.             CheckBox CardChoice = (CheckBox)DGI.FindControl("CardChoice");
  20.  
  21.                    }
  22.  
  23.     }
Nov 5 '08 #1
1 1001
DrBunchman
979 Expert 512MB
Hi panneer,

Welcome to Bytes.com! I hope you find the site useful.

You've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

Regards,

Dr B
Nov 5 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Franco Fellico' | last post by:
Hi everybody. Suppose to have a table dinamically created in a form where I show some information of a set of row selected in a db-table: ....... while($row = mysql_fetch_array($result)) {...
9
by: Phil Powell | last post by:
I am producing a form using PHP on the back end and Javascript on the front end. The resulting script will come to the browser as follows: <script> <!-- function selectAll() { moveElement =...
7
by: Rodney King | last post by:
Hi, I have developed an ASP page which dynamically displays a list of checkbox options based on a SQL statement. Here is my code: <div style="OVERFLOW:auto; Height: 150px"> <table> <% dim...
5
by: Jez | last post by:
Hi, I have created the following functions to select and deselect checkboxes in a form ... function check(checkbox) { for (i = 0; i < checkbox.length; i++) { checkbox.checked = true; }...
1
by: Eric | last post by:
Hi all, I have a form that generates a dynamic number of rows from a value passed in via querystring. I have a one static row in my form with a "master" checkbox that I have deemed "Select...
5
by: Dave | last post by:
Hi all, Apologies if this is the wrong group. I have done a search on google but my keywords are probably no good. What I want to do is to display a list of data in a datagrid (which I have...
1
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been...
3
by: newjazzharmony | last post by:
Hello group, I want to automatically select a specific checkbox when a user clicks (selects) a specific item in a radiobutton group. Both controls are in the same form. Let's say for...
0
by: san1014 | last post by:
Hi to all' I am using Java swings. I written a code to display a table. In the table i used Boolean.class type column. when i click the checkbox it value to be change from false to true....
9
greensleeves
by: greensleeves | last post by:
Hi, Im a newbie to PHP and I'm wondering if someone could help me out with this Tryng to search out products from a database by clicking a checkbox option for instance if description contains...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.