473,833 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

checkbox in datalist

23 New Member
i have checkbox in datalist and i need to find which checkbox is checked
name of checkbox = CheckBox1
and name of datalist is DataList1

i am writng this code to find the checked checkbox
Expand|Select|Wrap|Line Numbers
  1. foreach (DataListItem dli in DataList1.Items)
  2. {
  3.  
  4. bool ok = ((CheckBox)dli.FindControl("CheckBox1")).Checked;
  5. if (ok)
  6. {
  7. // ok 
  8. }
  9. }
  10.  
but the result is always false what i have to do


10x
Oct 16 '07 #1
4 1168
jhardman
3,406 Recognized Expert Specialist
moved to .NET forum.

Does "10x" refer to strength or size?
Oct 17 '07 #2
Frinavale
9,735 Recognized Expert Moderator Expert
i have checkbox in datalist and i need to find which checkbox is checked
name of checkbox = CheckBox1
and name of datalist is DataList1

i am writng this code to find the checked checkbox
Expand|Select|Wrap|Line Numbers
  1. foreach (DataListItem dli in DataList1.Items)
  2. {
  3.  
  4. bool ok = ((CheckBox)dli.FindControl("CheckBox1")).Checked;
  5. if (ok)
  6. {
  7. // ok 
  8. }
  9. }
  10.  
but the result is always false what i have to do


10x
Is this a desktop application or an asp.net application?

-Frinny
Oct 17 '07 #3
simonakiki
23 New Member
Is this a desktop application or an asp.net application?

-Frinny
no this is a asp application and i am moving this question to asp form but no replys till now

if u can help me

10xxxxx
Oct 19 '07 #4
jhardman
3,406 Recognized Expert Specialist
no this is a asp application and i am moving this question to asp form but no replys till now

if u can help me

10xxxxx
if 1x means extra large, then 10xxxxx must mean realy really big!

umm. maybe I misunderstood you. When you say an asp application, which version do you mean? Is this classic ASP or ASP.NET? generally there is nothing in classic ASP referred to as a datalist and you can't write classic ASP with C or C++ or C#, so that's why I moved this to .NET in the first place.

Jared
Oct 19 '07 #5

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

Similar topics

4
5956
by: mahsa | last post by:
my problem dosent solve yet I want to have claa void in onclick of my check bov if I us function setProps ( ) msg.innerText = "llll"; in <datalist> <ItemTemplate><input type="checkbox" id="cbItem" runat="server" onclick="test() value='<%#DataBinder.Eval(Container.DataItem, "PartNo")%>' NAME="cbItem"><%#DataBinder.Eval(Container.DataItem, "PartNo")%><td class='item_content' width='83'><input value=4 maxLength='4' size='4'...
1
3344
by: Glenn Owens | last post by:
Here's the scenario: I have a DataList populated from a datatable sitting inside a fieldset. Each element (row) in the Datalist has the following child controls: asp:checkbox, asp:image, asp:labels. Within the <form>, but outside the fieldset, containing the datatlist, I have a usercontrol (used to collect search criteria) and some asp:button controls (used to initiate actions - ie. retrieve db data, reset user control fields,...
0
1290
by: yurps | last post by:
Hello I have a DataList like this <asp:DataList id="Questions" Runat="server"> <ItemTemplate> <table border="1"> <tr> <td> <asp:CheckBox ID="Yes" Runat="server"></asp:CheckBox> <input type="hidden" runat="server" value='<%# DataBinder.Eval(Container.DataItem, "I_QUESTION_ID") %>' ></input>
1
3782
by: VB Programmer | last post by:
Simple: I have a datalist that is holding a bunch of job opportunities. Beside each opp (in the item template) there's a checkbox that says "apply". After the datalist there's a button that say's "process". I want to LOOP through each datalist entry and see if the user checked the check box. Simple. I wrote the code, but the checked value is ALWAYS False. Any ideas? Here's the code...
2
1536
by: Derek | last post by:
I have a datalist that contains one unbound column with a checkbox. When the user clicks a button, I need to count all the checked boxes in the datalist. Can anyone give me an idea as to the best way to do this? Thanks.
0
1523
by: Patrick Olurotimi Ige | last post by:
I want to insert checkbox Y/N or 1/0 into a SQL table. I know i can do that using a bit field or Char field. My Question is i have Datalist that lists products and i want to put this checkBoxes in the Datalist. But in the Datalist there is a Link that adds the Products to a SQL table My Datalist looks like this below:- <asp:datalist id="MyList" runat="server" RepeatColumns="2"> <ItemTemplate>
2
2026
by: Paperback Writer | last post by:
I have a DataList with a lot of items where the user can select them trough the CheckBoxes but i don't have idea how to capture these values from the checkboxes to insert in my DataBase....How to accomplish that ? -- Please, check my theSpoke: http://www.thespoke.net/MyBlog/dgroh/MyBlog.aspx
1
2176
by: rn5a | last post by:
A ASPX page has a DataList control with a few Labels. This page also has a CheckBox which resides OUTSIDE the DataList. By default, this CheckBox is checked. If the CheckBox is checked, then the Labels existing in the DataList should be visible but if the CheckBox is unchecked by the user, the Labels inside the DataList should be made invisible. How do I do this? Note that the AutoPostBack property of the CheckBox has been set to
0
1179
by: simonakiki | last post by:
i have checkbox in datalist and i need to find which checkbox is checked name of checkbox = CheckBox1 and name of datalist is DataList1 i am writng this code to find the checked checkbox foreach (DataListItem dli in DataList1.Items) { bool ok = ((CheckBox)dli.FindControl("CheckBox1")).Checked;
1
1478
by: rrayfield | last post by:
I create a datalist from a datatable that is created in code on the page. I have all of my values assigned to dropdowns and labels inside the DL and it runs through them. Everything works great BUT I have added a checkbox to Datalist and now want to set visable= false to the items in the datalist of the checkbox is check (on post back of course).. But I cannot find where I should put my code for this. in what function? ...
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10782
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9323
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7753
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6951
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3078
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.