Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2005
    Thanked 0 Times in 0 Posts

    How to get value of selected dynamic checkboxes in ASP.net?

    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


    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.

    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.

    Attached Thumbnails Attached Thumbnails How to get value of selected dynamic checkboxes in ASP.net?-checkbox-image.jpg  

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Cincinnati, OH
    Thanked 0 Times in 0 Posts
    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
    End If
    Next ctl
    does this sig match?


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts