可以通过Session变量存储登陆时的用户ID,在点击TreeView时判断Session的值
if (Session["UserID"]== null)
     Response.Redirect("Default.aspx");//登陆页面