Well, you can access public items of your master page from content pages. In that purpose, you have to get Page.Master in your content page code and cast it to your master page class.
In your master page code: Public Sub ExpandANode(Byval nodePath as String) Dim MasterTree As TreeView MasterTree = DirectCast(Master.FindControl("TreeView1"), TreeView) MasterTree.FindNode(nodePath).Expand End Sub In your content page: Dim mpage as MasterPageClass = CType(Page.Master, MasterPageClass) mpage.ExpandANode(nodePath) Then, you just have to find the correct nodePath to feed it to your method. I trust you can fill in the blanks. On 18 août, 14:17, ScoobyDoo12 <linear...@yahoo.com> wrote: > I need to expand one of the nodes in my treeview from a content page. > Everything I have tried has not worked. The Treeview is located in a > Master Page and built from a web.sitemap. I have a content page that > is not listed in the sitemap, but I still need to expand the node. > Please provide the solution in VB. > > I have been able to expand by depth by using the following. > > Dim MasterTree As TreeView > MasterTree = DirectCast(Master.FindControl("TreeView1"), TreeView) > MasterTree.ExpandDepth = 0 > What I need to do is to pick a child node and expand it from the > content page. (the administration node) > > Thank you in advance for your assistance. Below is my Sitemap > > <?xml version="1.0" encoding="utf-8" ?> > <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > > <siteMapNode title="Main Menu" description="Main Menu" > url="Default.aspx"> > > <siteMapNode title="Items For Bid" description="Items For Bid" > url="ItemsForBid.aspx" securityLevel=""></siteMapNode> > > <siteMapNode title="UW Representative" description="UW Admin" > url="" > securityLevel="200"> > <siteMapNode title="Add Items To Auction" > description="Add Items To > Auction" url="AddAuctionItem.aspx"></siteMapNode> > </siteMapNode> > > <siteMapNode title="UW Admin" description="UW Admin" url="" > securityLevel="500"> > <siteMapNode title="Approve Items For Auction" > description="Approve > Items For Auction" url="ApproveItemsForAuction.aspx"></siteMapNode> > <siteMapNode title="List Of Items Won" > description="List Of Items > Won" url="ItemsWon.aspx"></siteMapNode> > </siteMapNode> > > <siteMapNode id ="xxxx" title="Administration" > description="Administration" url="" securityLevel="900"> > <siteMapNode title="Add Security" description="Add > Secruity" > url="Admin/SecuritySearchNew.aspx" /> > <siteMapNode title="Update Secruity" > description="Update Secruity" > url="Admin/SecuritySearchExist.aspx" /> > <siteMapNode title="Department Maintenance" > description="Department > Maintenance" url="Admin/AdminMaint.aspx?MyType=Department" /> > <siteMapNode title="Auction Close Date" > description="Auction Close > Date" url="Admin/SetStopDate.aspx" /> > <siteMapNode title="Update Items" description="Update > Items" > url="Admin/UpdateItems.aspx" /> > </siteMapNode> > > <siteMapNode title="Contact Us" description="Contact Us" > url="ContactUs.aspx" securityLevel=""></siteMapNode> > > </siteMapNode>