I found it with this.
Dim tv As TreeView = CType(CType(Page.Master.Fi
Now if I could only figure out why it wont stay selected I would be golden.
Thanks for your help.
Main Topics
Browse All TopicsI have a userControl with a treeView in a masterPage. I need information from the selected node of the treeView in the under lying page. How do I find the treeView in the userControl that is in the masterPage while I am in the page.
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
hey .. thats not difficult .. here is the way
Dim tv As TreeView = CType(CType(Page.Master.Fi
dim td as TreeNode = tv.SelectedNode;
now you can get all properties of selected treenode.
further if you have any prob .. please feel free to ask
thanks
Business Accounts
Answer for Membership
by: needo_jeePosted on 2007-11-08 at 19:40:10ID: 20247422
This is working code...
l)this.Fin dControl(" WebUserCon trol1")).F indControl ("TreeView 1"));
rty/archiv e/2006/03/ 21/ASP.NET -2.0- Maste r-Pages-an d-Content- Pages-even t-sequence .aspx ********** ** l)this.Fin dControl(" WebUserCon trol1")).F indControl ("TreeView 1")); .Text);
l)this.Fin dControl(" WebUserCon trol1")).F indControl ("TreeView 1")); .Text);
I have written it in load event of master page.
but remember .. you will not be able to find nodes of tree on first time page load.
TreeView tv = ((TreeView)((WebUserContro
because .. if you have populated your treeview in load event of any content page or usercontrol .. then according to event model of master pages.. the master page load event occures first and the "Content controls Load event " after that...
for details kindly check this link
http://blogs.msdn.com/pete
**************************
if you are populating treeview in load event of your user control then
you cant do this in master page load event
TreeView tv = ((TreeView)((WebUserContro
Response.Write(tv.Nodes[0]
you can do like this
if(isPostBack)
{
TreeView tv = ((TreeView)((WebUserContro
Response.Write(tv.Nodes[0]
}
thanks