Help - Treeview - SelectedIndexChange Event

P

Phil

Hello...
I have a treeview that looks something like:

Root
.....Folder1
.........FolderA
.............Page
.........FolderB
.............Page
.....Folder2
.........FolderA
.............Page
.........FolderB
.............Page

When a user clicks on a "Page" node, I need to save the name of the page clicked and redirect to another .aspx. However, if a user clicks on a "Folder" node, I want nothing to happen. So, in my code behind file, I have:

private void idTreeViewreports_SelectedIndexChange(object sender, Microsoft.Web.UI.WebControls.TreeViewSelectEventArgs e)
{
[I need help here... How to get the name of the of the selected node.]
Response.Redirect("reportsDateSelection.aspx");
}

The problem with this code is that clicking a folder node also causes a redirect. I only want to do this if a page node is clicked.

Is this the best way to do this? If so, how do I code it so that I only get page node clicks, not folder nodes?
If there's a better way of doing this, I'm all ears.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top