473,405 Members | 2,282 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,405 software developers and data experts.

TreeView - want node selection WITHOUT POSTBACK

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
Apr 11 '06 #1
9 21799
You could consider using AJAX (or ATLAS in MS-speak) http://atlas.asp.net

"Martin Randall" wrote:
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

Apr 12 '06 #2
I'm pretty sure that's what they use on this forum!

"DHLennon" wrote:
You could consider using AJAX (or ATLAS in MS-speak) http://atlas.asp.net

"Martin Randall" wrote:
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

Apr 12 '06 #3
On the treeview:
PopulateNodesFromClient = true
EnableClientScript = true

On each node you add to the treeview:
PopulateOnDemand = true

Make sure to only do this on nodes that have children (save your bandwidth).
The only other thing you have to do is add an event handler to the
TreeView's TreeNodePopulate event. The event args include the node that
needs its children populated. Just stick new child nodes in it and that's
that! Its nice, but there are some bugs that need to get worked out of it...

"Martin Randall" wrote:
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

Apr 12 '06 #4
Okay... nice answer, but not to the question I asked, but nice answer
anyway...
"William Sullivan" <Wi*************@discussions.microsoft.com> wrote in
message news:86**********************************@microsof t.com...
On the treeview:
PopulateNodesFromClient = true
EnableClientScript = true

On each node you add to the treeview:
PopulateOnDemand = true

Make sure to only do this on nodes that have children (save your
bandwidth).
The only other thing you have to do is add an event handler to the
TreeView's TreeNodePopulate event. The event args include the node that
needs its children populated. Just stick new child nodes in it and that's
that! Its nice, but there are some bugs that need to get worked out of
it...

"Martin Randall" wrote:
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

Apr 13 '06 #5
Tsk... anyway of doing it *without* using AJAX? And if I did use AJAX, I
would still need to trap the clientside event without causing a postback
which is the whole point of this post in the first place.

"DHLennon" <DH******@discussions.microsoft.com> wrote in message
news:8B**********************************@microsof t.com...
You could consider using AJAX (or ATLAS in MS-speak) http://atlas.asp.net

"Martin Randall" wrote:
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

Apr 13 '06 #6
You may want to look at the treeviews from obout.com (free) or
componentart. One nice thing with each of these is that they
dynamically fill branches without either a visible postback or ajax, by
calling a separate aspx page to fill the branch. Very intriguing when
you see it.

On the other hand, these treeviews have their own idosyncrasies, and
you may end up using one for a while and then finding a limitation
that's a show stopper.

Apr 13 '06 #7
I think what he's asking is how to remove the call to:

javascript:__doPostBack

from the TreeView node expand or collapse image.

I'm having the same problem. Is there any way to get rid of that
javascript function call?

Here's an example of what is added when I view the source:
<a
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tvNavigate','tFY2008')"><img
src="/FMFIMET/WebResource.axd?d=T97pv8xbNNluDolWp8ffnd8xHGrs20Gj DDdugfkoz5QUFUuDBCccU4RYFtFa3B9p0&amp;t=6327449049 71536555"
alt="Collapse FY2008" style="border-width:0;" /></a>

Apr 24 '06 #8
Well, I have the same question. I use the TreeView for a handy container for
related information. I just want it to expand/contract clientside. But I DO
NOT want it to "javascript:__doPostBack" on node select. There's no
AutoPostBack = false as far as I can see or way to override this click event.

So, how iz it done?
"wa******@gmail.com" wrote:
I think what he's asking is how to remove the call to:

javascript:__doPostBack

from the TreeView node expand or collapse image.

I'm having the same problem. Is there any way to get rid of that
javascript function call?

Here's an example of what is added when I view the source:
<a
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tvNavigate','tFY2008')"><img
src="/FMFIMET/WebResource.axd?d=T97pv8xbNNluDolWp8ffnd8xHGrs20Gj DDdugfkoz5QUFUuDBCccU4RYFtFa3B9p0&t=63274490497153 6555"
alt="Collapse FY2008" style="border-width:0;" /></a>

May 1 '06 #9
Nevermind, I figured it out. When you assign the Text of the node, just wrap
the text in a <span> and intercept the click so it doesn't bubble to the <A>
which is where the postback is picked up.

Ex:
node.Text = "<span onclick='return false;'>"+NodeLabel+"</span>";

"Aaron Zalewski" wrote:
Well, I have the same question. I use the TreeView for a handy container for
related information. I just want it to expand/contract clientside. But I DO
NOT want it to "javascript:__doPostBack" on node select. There's no
AutoPostBack = false as far as I can see or way to override this click event.

So, how iz it done?
"wa******@gmail.com" wrote:
I think what he's asking is how to remove the call to:

javascript:__doPostBack

from the TreeView node expand or collapse image.

I'm having the same problem. Is there any way to get rid of that
javascript function call?

Here's an example of what is added when I view the source:
<a
href="javascript:__doPostBack('ctl00$ContentPlaceH older1$tvNavigate','tFY2008')"><img
src="/FMFIMET/WebResource.axd?d=T97pv8xbNNluDolWp8ffnd8xHGrs20Gj DDdugfkoz5QUFUuDBCccU4RYFtFa3B9p0&t=63274490497153 6555"
alt="Collapse FY2008" style="border-width:0;" /></a>

May 1 '06 #10

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...
4
by: Andrew Robinson | last post by:
I am using a TreeView to perform navigation and have a few nodes that need to generate a popup menu. For this, I use the SelectedNodeChanged event and then add the relevant "window.open" script to...
1
by: Daves | last post by:
Sorry folks but I will be reposting this question from 6/5 until someone gives me an answer - the question is very easy and so ought the answer to be. I really need the answer! ------- I'm...
0
by: amirmi | last post by:
Hi, I Have a Treeview that represent Stock Indicators. The idea is when i press the indicator i want it to create a client-side table with all the parameters of this indicator - which are listed...
5
by: tmldias | last post by:
Hi all, I've already "lost" too many time and no success... I want to remove the default postback when the user presses a node in the tree. I want to navigate and selecte nodes in the tree...
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...
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...
2
by: makennedy | last post by:
Hi Experts, Please help, I am a newbie to ASP.NET 2.0 may be I am doing something wrong or there may be a bug somewhere. Basically I have a TreeView Control which I have created...
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.