473,545 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

??? - No Postback When Clicking on Folder in Treeview

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
|_Report4
|_Category2
|_Site1
|_Report5
|_Report6
|_Site2
|_Report7
|_Report8

(etc., etc. - note there could be any number of Category, Site, and Report nodes; the treeview is built from a database table)

In my application, I only want a postback to fire if the user clicks on a Report node. I want nothing to happen if they click on the Root node or any Category or Site nodes (i.e., I don't want a postback or anything else).

Through C# code-behind I've been able to "short-circuit" if the user clicks on a node that's node a Report node by checking the type of the node and if it's not of type "Report" then do nothing. But, this still needs a postback to check the node type and everything else.

So, since I'm not JavaScript expert, I thought I'd post this message to see if anyone knew how to edit the treeview.htc file so that only clicking the Report nodes actually fired a postback and whatever else it does. Any one know how to do this? Any other suggestions?

TIA!

Nov 18 '05 #1
2 3932
jm

"George M." <gm@yahoo.com > wrote in message news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
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
|_Report4
|_Category2
|_Site1
|_Report5
|_Report6
|_Site2
|_Report7
|_Report8

(etc., etc. - note there could be any number of Category, Site, and Report nodes; the treeview is built from a database table)

In my application, I only want a postback to fire if the user clicks on a Report node. I want nothing to happen if they click on the Root node or any Category or Site nodes (i.e., I don't want a postback or anything else).

Through C# code-behind I've been able to "short-circuit" if the user clicks on a node that's node a Report node by checking the type of the node and if it's not of type "Report" then do nothing. But, this still needs a postback to check the node type and everything else.

So, since I'm not JavaScript expert, I thought I'd post this message to see if anyone knew how to edit the treeview.htc file so that only clicking the Report nodes actually fired a postback and whatever else it does. Any one know how to do this? Any other suggestions?

TIA!

Why does it postback at all? Just curious. Mine does not do this.
---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.680 / Virus Database: 442 - Release Date: 5/9/2004
Nov 18 '05 #2
Ram
You do not need to edit the htc file. Try to use treeview client
behaviors. Refer MSDN for help.
-------
Ram
pa*********@ksh ema.com

"George M." <gm@yahoo.com > wrote in message news:<#W******* *******@TK2MSFT NGP11.phx.gbl>. ..
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
| Report4
| Category2
| Site1
| Report5
| Report6
| Site2
| Report7
| Report8

(etc., etc. - note there could be any number of Category, Site, and
Report nodes; the treeview is built from a database table)

In my application, I only want a postback to fire if the user clicks on
a Report node. I want nothing to happen if they click on the Root node
or any Category or Site nodes (i.e., I don't want a postback or anything
else).

Through C# code-behind I've been able to "short-circuit" if the user
clicks on a node that's node a Report node by checking the type of the
node and if it's not of type "Report" then do nothing. But, this still
needs a postback to check the node type and everything else.

So, since I'm not JavaScript expert, I thought I'd post this message to
see if anyone knew how to edit the treeview.htc file so that only
clicking the Report nodes actually fired a postback and whatever else it
does. Any one know how to do this? Any other suggestions?

TIA!

--

Nov 18 '05 #3

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

Similar topics

2
5716
by: Carter | last post by:
i have a treeview on a webform (.aspx). when the user selects an appropriate node on the tvw. and clicks on a link button, i'm downloading a corresponding file to the client (from the server). so far so good. all of that works. after the download, i want to refresh the treeview and redisplay the current node with a different color. and also...
8
12738
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 form. I only want to allow single selection, so using checkboxes is out of the question. It works as is, but it makes the form very cumbersome if...
1
5021
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, this is not possible out of the box. Does anyone have a solution/workaround/hack for this?
2
1707
by: BillE | last post by:
I am using master/content pages, with a treeview in my master page. When the selected node changed event fires in the treeview, I redirect to the requested content page associated with the selected node in the treeview. When this treeview event occurs in the master page, I noticed that the current content page posts back (IsPostback is...
26
8484
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 to look like a column of buttons that expand to show the child nodes (if there are child nodes) qithout a postback. I don't want to display the...
2
3942
by: pbd22 | last post by:
Hi. Can somebody tell me how to prevent a postback when I click on the little "plus" sign next to the treenode's root folder? It postbacks and I have to restart a video stream coming to the page via an iframe. I have tried javascript:void(0) and that doesn't work.
0
1394
by: MrColeyted | last post by:
I am designing an app that is similar to Windows Explorer. I have all working well. By clicking a directory in the treeview, the folders and files for that directory are displayed in the listview. I want to know how to: By clicking a folder in the listview, expand and repopulate the corresponding node in the treeview. I have literally tried...
0
1765
by: =?Utf-8?B?V2FubmFiZQ==?= | last post by:
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...
0
1919
by: ton | last post by:
Hi, In my website the treeview is placed in the update panel of AJAX. Clicking on the nodes, the server side code is getting the childnotes and shows the details on the right site of the treeview. just like an normal exploere would do. After clicking on several nodes, I'll got deeper in the tree and after a while, the right site shows the...
0
7464
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7396
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5323
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4943
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3440
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1874
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
700
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.