Question

I have a custom user control loaded into a sublayout in Sitecore. When I click on a menu tree item I would like to reference the name of the menu item in my control. How can I get a reference to the selected menu item? I can get a reference to the content folder that the menu items are sitting in, but not to the selected item.

Please let me know if you can answer. Thanks!

UPDATE: allow me to provide some better detail. I am using the Sitecore 6.2 starterkit which has content organized into a tree-view on the left side of the page. When I click on an item in the tree view a new page loads with my custom user control in it. The user control is set up to accept a parameter which is the name of the tree-view item. My question is how can I get a reference to the name of the clicked on tree-view item in the c# code-behind.

Was it helpful?

Solution

Huh, that was easier than I thought. Here's how to get a reference to the menu item

Sitecore.Context.Item.Name
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top