473,387 Members | 3,684 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.

Check box list

147 100+
Hello

How do I display a checked check box list?

I have a list which gives options A, B and C.

If some one checks A and C and clicks Search, I just want it to write A and C!
If some one checks B and clicks Search, I just want it to write B!

My code doesn't work (it can't convert from Char to String)


public void btnSearch_Click(object sender, EventArgs e)
{
foreach(string P in Convert.ToString(chkP.Text))
{
Response.Write(P);
}
}
I know this must be a simple thing, but I can't work it out! Any help?

Thanks
Mar 30 '09 #1
1 1505
DaveRook
147 100+
Hi

Expand|Select|Wrap|Line Numbers
  1.     public void btnSearch_Click(object sender, EventArgs e)
  2.     {
  3.         for(int i=0; i<chkPitch.Items.Count;i++)
  4.         {
  5.             if (chkPitch.Items[i].Selected)
  6.             {
  7.                 Response.Write(chkPitch.Items[i].Text + "<br />");
  8.             }
  9.         }
  10.     }
Mar 30 '09 #2

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

Similar topics

0
by: Alex82 | last post by:
I can't use it....for example i have to create a column that accept values between 1 to 120...i can't enumerate all of them....or i have to accept a value different from NULL if an other column has...
8
by: pw | last post by:
Hi, I need to create a function in javascript to check or uncheck all checkboxes in a form. From what I understand, I can do this either by specifying the name of the check box fields such as: ...
0
by: H. Scott Buckwalter | last post by:
ASP.NET: I want to control the color of the text for a check box control in JavaScript on the client. I am able to do this by surrounding the check box in a SPAN tag. I then color the span and...
16
by: Brian Tkatch | last post by:
Is there a way to check the order in which SET INTEGRITY needs to be applied? This would be for a script with a dynamic list of TABLEs. B.
1
by: Spectre1337 | last post by:
Hello, it seems like the check constraint validation of MS SQL Server Management Studio express is horribly, horribly broken. Either that or I'm using it wrong. I hope it's the latter. I'm...
3
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
I've a multiview with 3 views. on view 2 the user is presented with a check box list (items from database) at view 3 the user can review their selections and, either post to the database or go back...
5
by: Andrew Meador | last post by:
I have a form (Change Card List by Status) with a check box (cboNOT) and a list box (lstStatus). There is an Open Report button that opens a report (Report - Change Card List) which uses a query...
6
by: dudeja.rajat | last post by:
Hi, How to check if something is a list or a dictionary or just a string? Eg: for item in self.__libVerDict.itervalues(): self.cbAnalysisLibVersion(END, item) where __libVerDict is a...
5
by: =?Utf-8?B?THVpZ2k=?= | last post by:
Hi all, having a List<stringand Dictionary<int, stringhow can I check that every string in the list is also in the Dictionary (and viceversa)? (and raise an exception when not). Thanks in...
1
by: ajitmalkar | last post by:
I have a "Select All" Check Box and Check Box List in columns of Repeater Control. I want to select all check box list check boxes on click of check box in individual row. How to achive this ? Any...
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
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.