473,320 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

TreeView Postback

I have a treeview setup on my page. In case it is relevant, it is set in an
accordion, which is inside an update panel. When I click the treeview node, a
page loads on the right side of my browser as it should. When I click the
same node, the right side of my browser goes blank. I do not want it to go
blank if the user clicks the same node. I would like it to not change. At
this point, I do not know how it is happening. Is there a property I can set
to keep this from happening? Can someone explain this to me? Thank you.

Below is the markup and the event that is run on first click:
<asp:UpdatePanel ID="upMain" runat="server">
<ContentTemplate>
<ajaxToolkit:Accordion ID="AccordionHome" runat="server"
ContentCssClass="accordionContent" FadeTransitions="true"
FramesPerSecond="40" HeaderCssClass="accordionHeader"
RequireOpenedPane="false" SelectedIndex="9" SuppressHeaderPostbacks="true"
TransitionDuration="40" Width="275px" AutoSize="None">
<Panes>
<ajaxToolkit:AccordionPane ID="apAccountSetup" runat="server"
ToolTip="Click to Expand / Collapse">
<Header>
<a class="accordionLink" href=""> 1A Account Setup</a>
</Header>
<Content>
<asp:ImageButton ID="btnNoteClient" runat="server"
ImageUrl="Images/Accordion/notes.gif" ImageAlign="Right"
CausesValidation="False" CommandName="Note" CommandArgument="Client"
ToolTip="Development Notes" OnClick="btnNoteClient_Click" />
<asp:TreeView ID="tvAccountSetup" runat="server"
SelectedNodeStyle-BackColor="Yellow" Font-Size="10pt" Font-Bold="True"
NodeStyle-HorizontalPadding="5px"
OnSelectedNodeChanged="tvAccountSetup_SelectedNode Changed">
<Nodes>
<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" />
</Nodes>
</asp:TreeView>
</Content>
</ajaxToolkit:AccordionPane>
</Panes>
</ajaxToolkit:Accordion>
</ContentTemplate>
</asp:UpdatePanel>
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.
try
{
PlaceHolder1.Controls.Clear();

//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 +
".ascx");
PlaceHolder1.Controls.Add(c);
}
catch
{
}
}

Jun 27 '08 #1
0 1746

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: George M. | last post by:
I'm working with the treeview control on an ASP.NET page (written in C#), and I have one built the looks something like: Root |_Category1 |_Site1 |_Report1 |_Report2 |_Site2 |_Report3...
0
by: xzzy | last post by:
I am using www.obout.com 's treeview control and their postback dll ( for an aspx web page ). The treeview and no postback works, BUT the postback dll keeps getting removed from the solution. No...
9
by: Martin Randall | last post by:
Can anyone tell me if it is possible to get the TreeView control in ASP.Net 2.0 to allow node selection without triggering a postback? Thanks! Martin Randall
1
by: kvicky | last post by:
I am trying to load child nodes to a TreeNode in a TreeView in a ASP.net web application. The Treeview with parent nodes are loaded on a Page_load while doing if( ! ISPostback ) and then in the...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
1
by: japi | last post by:
Hi all, I have a TreeView control in my ASP.NET 2.0 Web application with checkboxes enabled. I would like to generate a postback when a user ticks or unticks a checkbox. As far as i know,...
26
by: JJ | last post by:
Is there any way you can expand a parent node on the treeview control _without a postback_ by clicking on the node text (NOT clicking the expand image URL) ? I want to format the treeview node...
0
by: Joe Stateson | last post by:
I had thought that checkbox changes in a treeview only work at postback but I found this code that makes it work (sort of) on client click http://www.developerfusion.co.uk/forums/p/33913/149877/ ...
1
by: =?Utf-8?B?Rmx5Z3V5?= | last post by:
I have a TreeView with so many nodes that it requires scroll bars. When the user selects a node the screen is refreshed and the selected node is no longer visible. The TreeView is opened to the...
2
by: =?Utf-8?B?QW1pciBUb2hpZGk=?= | last post by:
Hi I have a web page that has a TreeView on it. If I DONT'T expand the TreeView nodes, the auto refresh works nicely: my page gets refreshed every minute. As soon as I expand a node on the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.