Help - Treeview - SelectedIndexChange Event

Discussion in 'ASP .Net Web Controls' started by Phil, Apr 29, 2004.

  1. Phil

    Phil Guest

    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.
     
    Phil, Apr 29, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    2
    Views:
    7,846
  2. Danny

    dropdown event SelectedIndexChange

    Danny, Apr 21, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    123
    Paulo
    Apr 23, 2004
  3. Stefan
    Replies:
    0
    Views:
    166
    Stefan
    Jul 18, 2003
  4. steven shingler

    treeview SelectedIndexChange problem

    steven shingler, Jul 25, 2003, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    143
    steven shingler
    Jul 28, 2003
  5. Randy
    Replies:
    4
    Views:
    171
    Jeffrey Tan[MSFT]
    Sep 23, 2003
Loading...

Share This Page