Oh, I see you're using getSelectedNode() function, but rather you need to find a checked node. This is not the same.
Your code should look like:
var tree = CFlyTreeView.getInstanceById('');
var checkedNode = tree.find(function(node) { return node.getChecked(); });
if (checkedNode == undefined) {
alert('no node checked');
} else {
alert('checked is' + checkedNode.getValue());
}
Also, for your code-behind, I moved initTree calls into !IsPostBack condition:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
initTree(topTree, "top");
initTree(bottomTree, "bottom");
}
}
Just to prevent adding additional root node every postback/callback.