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

Discussion in 'ASP .Net' started by George M., May 12, 2004.

  1. George M.

    George M. Guest

    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!
    George M., May 12, 2004
    #1
    1. Advertising

  2. George M.

    jm Guest

    "George M." <> wrote in message news:%...
    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
    jm, May 12, 2004
    #2
    1. Advertising

  3. George M.

    Ram Guest

    You do not need to edit the htc file. Try to use treeview client
    behaviors. Refer MSDN for help.
    -------
    Ram


    "George M." <> wrote in message news:<#>...
    > 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!
    >
    > --
    Ram, May 12, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Craig
    Replies:
    0
    Views:
    415
    Craig
    Dec 31, 2005
  2. Tor Inge Rislaa
    Replies:
    0
    Views:
    821
    Tor Inge Rislaa
    Feb 5, 2007
  3. George M.

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

    George M., May 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    108
    George M.
    May 12, 2004
  4. William Main

    Fixed bug in IE Treeview Webcontrol when clicking on leaf node.

    William Main, Feb 1, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    250
    William Main
    Feb 1, 2005
  5. Nadav Popplewell

    problem with clicking on already selected node in TreeView

    Nadav Popplewell, Mar 28, 2007, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    535
    LaBrina Loving
    Apr 3, 2007
Loading...

Share This Page