By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,159 Members | 1,880 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,159 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.