Hi,
 
I created a user control that has a treeview ie web control  populated
from database.  I am loading the user control dynamically on a aspx
page.
 
I am keeping track of the selected treenode of the treeview by using a
method doRecursion I got from Shannon in this group shown below. There
is no problem with the code.  The code works fine.  But to stop the
treeview from getting populated everytime, I cached the user control.
 
So now my response time is faster, but since the Page_load of the user
control does not run until the duration set in the outputcache
directive, the doRecursion method does not run and so when page loads
again the treeveiw collapses and the first node of the treeview appears
highlighted by default.
 
Can anybody help me on how to cache the usercontrol at the same time
manage the selected treenode appear as selected the next time the page
loads.
 
I will be eagerly waiting for a solution.  Thankyou in advance.
 
Raj.
 
 
 
      private void doRecursion(TreeNodeCollection t)
            {                 
                  foreach (TreeNode tn in t)
                  {
                        if(nodeIndex != null && tn.GetNodeIndex() ==
nodeIndex)
                        {
 
doParentExpanding(tn.GetSiblingNodeCollection());
                              TreeMenu.SelectedNodeIndex =
tn.GetNodeIndex();
                              return;
                        }
                        
                        doRecursion(tn.Nodes);
                  }
            }
 
            private void doParentExpanding(TreeNodeCollection t)
            {
                  if(t.Parent.ToString() == "TreeNode")
                  {                       
                        Microsoft.Web.UI.WebControls.TreeNode tn =
(Microsoft.Web.UI.WebControls.TreeNode)(t.Parent);
                        tn.Expanded = true;
 
doParentExpanding(tn.GetSiblingNodeCollection());
                  }
            }
 


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/saFolB/TM
---------------------------------------------------------------------~->

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
     [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 

Reply via email to