Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
Keeping the nodes checkboxes checked on postBack
posted

I have implemented the java script in the knowledge base to check all child nodes when the parent is checked. This works fine.

However when I try to either click a button/postback, the checked boxes get unchecked. This presents a problem because I need to know what the state of the check boxes are in so I can run something based on what's checked. I've also been able to write the recursive method (CheckAll) in the .cs code to check the child boxes but again, whenever the page reloads I can't check to see if a nodes is checked because it becomes unchecked. Hopefully I am just missing something simple but I can't figure it out.

what i want to do is something like

if (isPostBack)

         if (webtree.Nodes[i] .Checked ==true)

  { do something}

}

or

protected void Button click (object sender, EventArgs e)

{

    if (webtree.Nodes[i] .Checked ==true)

  { do something}

}