• 0

[ASP with C#] Need help with child nodes


Question

EDIT:

I had the last post all wrong.

My Question is I need to know how to add a link from a text box when i enter a favorite from a text box selecting btnFavorite.

using System;

public partial class _Default : System.Web.UI.Page 
{


    protected void btnCreateFolder_Click(object sender, EventArgs e)
    {
        TreeNode xTN = new TreeNode();


        if (tvTree.SelectedNode == null)
        {
            lblAnswer.Text = "Nothing Selected";
            return;
        }
        {
            xTN.Text = txtBoxFolderName.Text;
            xTN.NavigateUrl = "";
            xTN.Target = "_blank";
            tvTree.SelectedNode.ChildNodes.Add(xTN);
        }

    }

[b] How do i add a link from a textbox to this?[/b]
    protected void btnAddFavorite_Click(object sender, EventArgs e)
    {

        TreeNode xFN = new TreeNode();


        {
            xFN.Text = txtBoxEnterFav.Text;
            xFN.NavigateUrl = "";
            xFN.Target = "_blank";
            tvTree.SelectedNode.ChildNodes.Add(xFN);
        }


    }
}

Edited by The Grasshopper

2 answers to this question

Recommended Posts

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.