Last post Feb 24, 2012 09:47 AM by manga75
Jan 31, 2012 01:08 AM|manga75|LINK
Hi I have a site with a two aspx pages and a masterpage.
on the masterpage I have a treeview with a list of categories and when a category is selected I get a list of topics with a intro on each post.
URL example category: www.site.com/sports/soccer/europe/
categories can go three-four levels deep and if I click a specific post I get into the post.aspx
URL example post: www.site.com/post/2342-Zlatan-scores-again
What I want to do is when im in the Post page I want to highlight the category to which it belongs in the treeview...but considering that each post is not in the sitemap file it just looses focus...so how can I set the selected treeview node to be
www.site.com/sports/soccer/europe/ when im on the
Jan 31, 2012 06:11 AM|Sum8|LINK
On clicking posts of particular category, get the category of that post and store it into Session variable.
Now, in master page's Page_Load event, get category from Session variable and set the selected node accordingly.
Jan 31, 2012 01:08 PM|manga75|LINK
I have another way of getting it than session...but how do I set the selected node that way...it doesnt work...
Can you show me a working example because
treeview1.SelectedNode.NavigateUrl = "/sport/soccer/europe/"
what am I doing wrong?
Feb 01, 2012 06:53 AM|Sum8|LINK
No getting exactly what problem you are facing, but may the following links will help you:
Feb 02, 2012 08:01 AM|Frank Jiang - MSFT|LINK
</div> <div>I have another way of getting it than session...but how do I set the selected node that way...it doesnt work...</div> <div>Can you show me a working example because</div> <div>treeview1.SelectedNode.NavigateUrl = "/sport/soccer/europe/"</div> <div>what
am I doing wrong?</div> <div> </div>
Feb 16, 2012 11:54 PM|manga75|LINK
Feb 17, 2012 05:23 AM|Sum8|LINK
Make sure that the TreeView is getting populated before setting the selected node.
Feb 19, 2012 09:39 PM|manga75|LINK
I tried using a Session variable and put it in page_load doesnt work...am I suposed to use
Treeview1.SelectedNode.NavigateUrl = Session["Category"];
but I still get Object not set to a reference of an object...If I remove this line...I have the treeview visible with all categories collapsed and I print the value of the session variable so those two things work so basically it feels like that the tag
Treeview1.SelectedNode.NavigateUrl is not the right attribute to select a node.
is this something you can confirm or am I in the wrong...I really need to fix this...I have built the entire website and have everything working but this minor snag and I cant figure it out...so this is the only thing I have to fix before taking this site
Feb 20, 2012 06:24 AM|Sum8|LINK
Refer this link to set the SelectedNode :
Also, debug the application and before setting the SelectedNode, check whether TreeView is populated or not.
Feb 24, 2012 09:47 AM|manga75|LINK
Great thanks this article helped...thanks for your help!