Ask a Question related to ASP.NET General, Design and Development.
-
Ron #1
CheckBoxList -- Iterating Through Items
Can someone tell me how I can iterate through all of the Checkboxes included
within a checkbox list?
The code I currently have is as follows (it doesnt work for some reason, it
returns that no items are selected):
foreach(ListItem objItem in chkCategory.Items)
{
if(objItem.Selected == true)
{
category += objItem.Text;
}
}
Thanks,
Ron
Ron Guest
-
Creating master page where global items arearranged ABOVE local items
When you create a mater page, obviously all the items are arranged below anything on the individual pages. Is there a way of creating a master... -
Iterating through an XML Dataset
Hi.. I am new to trying to integrate any kind of data with Flash. I have Flash 8 Professional. I am fluent in ASP and JavaScript so I am... -
Iterating custom controls
Here's a simple problem that's eating my lunch: I need to write a base class method in ASP.NET that will iterate the page and find all controls... -
iterating through hash of hashes
I'd like to iterate through a hash of hashes and get all the values. How do I do that? The following works for me. But it seems a bit convoluted... -
Iterating through controls (VB)
I have been trying to iterate through the controls on my form and preset all textboxes to a cssClass. Unfortunately, I have been unable to figure... -
MYKEBLACK #2
Re: CheckBoxList -- Iterating Through Items
There's nothing obvious that you have done wrong, it could be that you are setting the checkbox items to unchecked in the page load, but not wrapping them in a if (!IsPostBack) { } conditional, so the checkboxes are regenerated each time you load the page. Another possiblity is that if you are using databinding then the code above is firing before the databinding, in which can you would need to put this code in a ondatabound() method.
without the full source code it is impossible to tell what is the cause.MYKEBLACK Guest



Reply With Quote


