tags:

views:

25

answers:

2

Can someone help me accomplish the following..... I want to create a function that will make a treeView out of link buttons. Then I want to tie all the link buttons to one click event. So each time the user does somethingI will append the users name to the current linkbuttons if the user clicks one of the link buttons a click event is raised and I can extract the text of that button.

Here is an example: Nick ...user does something...now the link string says Nick > Jeff ...user does something...now the link string says Nick > Jeff > Charlie and so on.

Now I want to give the user the ability to click one of these link buttons (there are 3 in this example). If the user clicks one of the buttons a click event is raised and I can extract the name out of the text of teh link button.

Can someone help me make a skeleton for this?

A: 

Hey,

Why not just use the standard ASP.NET TreeView control which supports clicking on nodes and managing node paths?

Brian
I cannot make the orentation horizontal in asp.net is the problem
Nick
When you click on a button, you can get the text of that button from the control click event. You can navigate up the parent trail by using the Parent reference manually.
Brian
A: 

You could programatically add link buttons on postback and wire them all up to the same event handler using the button.click += EventHandlerMethod syntax. You could work out which button has been clicked by casting the sender object in the event handler method to a linkbutton then accessing its text property.

Ben Robinson