Results 1 to 2 of 2

Thread: [2005] Refer to asp input checkbox in asp.net

  1. #1

    Thread Starter
    Addicted Member Tjoppie's Avatar
    Join Date
    Aug 2005
    Location
    South Africa
    Posts
    241

    [2005] Refer to asp input checkbox in asp.net

    Hi all,

    I've got a treeview which generates asp checkboxes on each node programatically and assigns an ID to them.

    now in another query, I want to "find" the checkbox, and change it's checked value to "checked" if the query tells me to...

    How do I find a normal asp control on an aspx page in my vb code?

    So... what I want to do is this...

    Generate the treeview and render all the checkboxes (This works, everything is rendered)

    Run another query, and as each line reads in the database, find the control (checkbox) and then check the checkbox in the tree if the sql query has the control id's checked column to true...

    All I actually wanna know is how can I call and change the checked property of the asp control.

    Thanks

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,174

    Re: [2005] Refer to asp input checkbox in asp.net

    It would help if you knew the naming convention for your checkboxes in the node so that you could find them programmatically, but what you can do for now is to loop through all the nodes in the treeview, then for each node, loop through each control in it, check its TypeOf (should be Checkbox or HtmlInputCheckBox), and then simply ctype() it, look at its .Checked property (true/false)

Posting Permissions

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



Click Here to Expand Forum to Full Width