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

??? - 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 3922
jm

"George M." <gm@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP11.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*********@kshema.com

"George M." <gm@yahoo.com> wrote in message news:<#W**************@TK2MSFTNGP11.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
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...
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,...
2
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...
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: 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...
0
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....
0
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...
0
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...

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.