Masterpage Treeview SelectedNodeChanged and Style errors

Discussion in 'ASP .Net Web Controls' started by biker, Aug 3, 2006.

  1. biker

    biker Guest

    Help!?

    Loss of formatting can be tolerated in this application, but for the menu to
    quit working...well...

    I have a treeview control on a masterpage.
    - ShowExpandCollapse is True.
    - DataSource is None.
    - HoverNodeStyle, NodeStyle, ParentNodeStyle and RootNodeStyle are set
    for desired values.
    - Nodes are manually entered.
    With the above settings, everything works fine...branches expand and
    collapse, URL links work, etc.

    I delete the nodes and set the DataSource to point to an XML file, setting
    the Name Field = Name value in the XML file and the Value Field = Permit
    value in the XML file, and, for CNode nodes, the URL Field = Target value in
    the XML file...now the formatting set by the various style entries quits
    working.

    I change the URL Field to blank and set the Target field Target value in the
    XML file...styles still do not work, and, of course, the links are gone, but
    expand/collapse still works.

    I create an event handler sub for the treeview SelectedNodeChanged event,
    just an empty subroutine...The event fires each time I click on a tree node,
    but, expand/collapse now affects the wrong nodes...not the one I click on.
    The first parent node works, the 2nd does nothing, the 3rd does nothing, the
    4th expands/collapses the 1st, the 5th works...you get the idea.

    I add code to get the Target value of the SelectedNode, and redirect to that
    URL. The SelectedNode points to the first leaf node within the group of leaf
    nodes under a parent node...no matter which leaf I click on.

    Here is my SelectedNodeChanged event handler, and a subset of my XML file:

    Protected Sub tvMenu_SelectedNodeChanged(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles tvMenu.SelectedNodeChanged
    If Validate_User(tvMenu.SelectedNode.Value, appsess.USER_ACCESS_CSV) Then
    If tvMenu.SelectedNode.Target <> String.Empty Then
    Response.Redirect(tvMenu.SelectedNode.Target)
    End If
    End Sub


    <?xml version="1.0" standalone="yes"?>
    <PACS Name="PACS Menu" Permit="ALL">
    <ANode Name="Data Interface" Permit="ALL">
    <CNode Name="Data Logger" Permit="ALL"
    Target="/PACS/App_Forms/DataInt/DataLogger.aspx" />
    <CNode Name="Log Inspection Results" Permit="ALL" Target="" />
    <CNode Name="View Inspection Results" Permit="ALL" Target="" />
    </ANode>
    <ANode Name="Reports" Permit="USER">
    <BNode Name="PACS Standard Reports" Permit="TEST">
    <CNode Name="Assembly Defect Summary" Permit="ALL"
    Target="/PACS/App_Forms/Rpts/reports.aspx?type=100" />
    <CNode Name="Disposition Summary" Permit="ALL"
    Target="/PACS/App_Forms/Rpts/reports.aspx?type=110" />
    <CNode Name="Closed Disposition Summary" Permit="ALL"
    Target="/PACS/App_Forms/Rpts/reports.aspx?type=120" />
    </BNode>
    </ANode>
    <ANode Name="Maintenance Functions" Permit="ALL">
    <CNode Name="Projects" Permit="ALL" Target="" />
    <CNode Name="Process" Permit="ALL" Target="" />
    <CNode Name="Areas" Permit="ALL" Target="" />
    <CNode Name="Variable Group" Permit="ALL" Target="" />
    </ANode>
    <ANode Name="Administration" Permit="ADMIN">
    <BNode Name="Maintain Users" Permit="ADMIN">
    <CNode Name="Create New User" Permit="ADMIN"
    Target="/PACS/App_Forms/Admin/user_new.aspx" />
    <CNode Name="Update Existing User" Permit="ADMIN"
    Target="/PACS/App_Forms/Admin/user_update.aspx" />
    </BNode>
    <CNode Name="Purge Test Data" Permit="ALL" Target="" />
    <CNode Name="Purge Unit Test Data" Permit="ALL" Target="" />
    <CNode Name="Shift Times" Permit="ALL" Target="" />
    </ANode>
    </PACS>
     
    biker, Aug 3, 2006
    #1
    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. Andrew Robinson

    TreeView SelectedNodeChanged Event

    Andrew Robinson, Dec 5, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    11,315
    Steven Cheng[MSFT]
    Dec 7, 2005
  2. tanya foster
    Replies:
    1
    Views:
    3,624
    tanya foster
    Jun 5, 2006
  3. Replies:
    0
    Views:
    451
  4. Velislav

    TreeView SelectedNodeChanged event

    Velislav, Nov 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    693
    Velislav
    Nov 24, 2006
  5. Replies:
    1
    Views:
    735
Loading...

Share This Page