Masterpage Treeview SelectedNodeChanged and Style errors

B

biker

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>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top