How to select a tree view node in asp.net
<p>I have the the following code sample</p>

<pre><code> private TreeNode AddNode(TreeNode node, string key)
    {
        var child = node.ChildNodes.Cast&lt;TreeNode&gt;().FirstOrDefault(_ =&gt; _.Value == key);
        if (child != null)
            return child;
        child = new TreeNode(key, key);
        child.SelectAction = TreeNodeSelectAction.SelectExpand;
        child.Selected = true;
        node.ChildNodes.Add(child); 
        return child;
    }
</code></pre>

<p>I'm not able to select the node. When I invoke <strong>treeview_SelectedNodeChanged</strong>, I'm getting NULL..</p>

<pre><code>string v = ((TreeView)sender).SelectedNode.Value;  
</code></pre>
