On my webpage their is a userwebcontrol that contains a checkboxlist.
im tryin to retrieve the checked values of this list using
Request.Form("ct100$TreatmentsCheckList")
but this returns nothing...
is their anyway to get the selected items
Printable View
On my webpage their is a userwebcontrol that contains a checkboxlist.
im tryin to retrieve the checked values of this list using
Request.Form("ct100$TreatmentsCheckList")
but this returns nothing...
is their anyway to get the selected items
Create a property in your UserControl that will return a collection of checked items. Loop through them, do whatever you need to do after.
hi serge, could you give me an example what you are talking about.
It means that you need to expose your checkbox list items.
So, you'd have something like
MyControlName.SelectedTreatments
You would access it from the parent page. Your control in turn would have a bit of logic in the get part for this public property. (SelectedTreatments is going to be your public property inside the user control)
That logic would need to loop through the actual control and find out what's checked and return those values.
Code:public List<string> SelectedTreatments
{
get
{
//Loop through the checkboxlist and find out which ones are selected, add them to your list of strings or whatever type you want.
}
}