Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Treeview problem

Thread Tools

Treeview problem

Mike Collins
Posts: n/a
I have a treeview, which is in an accordion, which is in an updatepanel. When
I click on a node in the treeview, it loads up a control as it should. When I
click on the same node again, the previously loaded control disappears and
does not get reloaded. I am not sure how this is happening. Can someone tell
me why this is happening and show me how to stop the control from being

HTML and event for the treeview:
<asp:UpdatePanel ID="upMain" runat="server">
<ajaxToolkit:Accordion ID="AccordionHome" runat="server"
FadeTransitions="true" FramesPerSecond="40"
RequireOpenedPane="false" SelectedIndex="9"
SuppressHeaderPostbacks="true" TransitionDuration="40"
Width="275px" AutoSize="None">
<ajaxToolkit:AccordionPane ID="apAccountSetup" runat="server"
ToolTip="Click to Expand / Collapse">
<a class="accordionLink" href="" onclick="hide('divPH1');
hide('divPH2'); return false;">
1A Account Setup</a></Header>
<asp:ImageButton ID="btnNoteClient" runat="server"
ImageAlign="Right" CausesValidation="False" CommandName="Note"
ToolTip="Development Notes" OnClick="btnNoteClient_Click" />
<asp:TreeView ID="tvAccountSetup" runat="server"
Font-Size="10pt" Font-Bold="True"
OnSelectedNodeChanged="tvAccountSetup_SelectedNode Changed">
<asp:TreeNode Value="Insights" Text="Insights"
ImageUrl="Images/Accordion/lightbulb.gif" />
<asp:TreeNode Value="ClientProfile" Text="Airline Profile"
ImageUrl="Images/Accordion/icon_left.gif" />
<asp:TreeNode Value="ClientBase" Text="Primary Program
Currency" ImageUrl="Images/Accordion/icon_left.gif" />
<asp:TreeNode Value="Help" Text="Help"
ImageUrl="Images/Accordion/qmark.gif" />

protected void tvAccountSetup_SelectedNodeChanged(object sender, EventArgs e)
//In case the page cannot be found, with this code in a try catch, it will
not error.

//Return the ID of the treeview. This will correspond to the folder the
//user control is located under.
//all tree views on the default page use the same two-character prefix
naming convention.
Control c = Page.LoadControl(@"UserControls\" +
tvAccountSetup.ID.Substring(2) + @"\" + tvAccountSetup.SelectedValue +

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to access the Page from a TreeNode (treeview 's element) : addinga context menu to a treeview abargaddon ASP .Net Building Controls 0 01-17-2008 11:05 AM
Microsoft Treeview vs System Treeview stepkurt ASP .Net Web Controls 1 09-02-2007 11:32 AM
ASP.NET 2.0 TreeView - Programatically Selecting A TreeView Node =?Utf-8?B?VHltYm93?= ASP .Net 2 01-10-2006 03:51 AM
Issue with a custom TreeView derived from the TreeView control Ionutz ASP .Net Web Controls 2 10-23-2005 03:23 PM
TreeView not rendering nodes? Cacheing of a TreeView Per Salmi ASP .Net Web Controls 1 10-15-2003 01:15 PM