...

View Full Version : How to get value of selected dynamic checkboxes in ASP.net?



frmsasp
10-14-2005, 11:18 AM
Hello there,

Currently I am working with the project which needs dynamically generated checkboxes and i have

generated dynamic checkboxes but i am facing problem with getting the value of selected checkboxes.

Problem is described below to understand easily, so please let me know if you come to know the

soln...

I am creating a form to assign rights to administrator of site for managing rights of different

modules from backend system. Please have a look at attached file to better understand the structure

of "admin rights" form which i have used.

Desciption:
There are four rights for each module and I want to set the rights will be allocated to selected

user based on the checked checkboxs. This data has to be send to database and that user will get

rights based on the rights given to him.
Plz tell me how (by which property or method) can I fetch the value of checkbox from this form.

Any help, advice or pointers on this matter would be highly appreciated.

Thanks,
Paresh

allida77
10-23-2005, 07:55 PM
Since the checkboxes are dynamic you will need to loop through the controls collection, get the type, and if it is one of your checkboxes grab the value.So lets say you put all your checkboxes inside a panel control called pnlOptions

For Each ctl as Control in pnlOptions.Controls
If TypeOf ctl is CheckBox Then
'CType(ctl,CheckBox).ID
End If
Next ctl



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum